Академический Документы
Профессиональный Документы
Культура Документы
This is a lot of code, and it doesn't let us group the friends together
0 1 2 3
0 1 2 3
var friends = ["Charlie", "Liz", "David", "Mattias"];
console.log(friends[0]) //"Charlie"
0 1 2 3
var friends = ["Charlie", "Liz", "David", "Mattias"];
friends[0] = "Chuck";
friends[1] = "Lizzie";
0 1 2 3
Arrays
We can also add new data
0 1 2 3
var friends = ["Charlie", "Liz", "David", "Mattias"];
friends[4] = "Amelie";
0 1 2 3 4
Arrays
Last few things
var friendGroups = [
["Harry", "Ron", "Hermione"],
["Malfoy", "Crabbe", "Goyle"],
["Mooney", "Wormtail", "Prongs"]
];
//Concatenation
"charlie" + "brown" //"charliebrown"