Arrays

  • Arrays hold ordered lists of values
  • Adding elements to an array is easy
  • Positions start at 0
const myFavoriteNumbers = [1,2,3];
const names = ["Alice", "Bob", "Eve"];
const mixed = ["Alice", 2, false];

for(const element of mixed) {
    console.log(element);
}

console.log(mixed[0]);
mixed[3] = "something";

11 / 24