Arrays


1. Arrays are lists where each spot has a number or "index"

var kitchenStuff = ['Frying Pan', 'Spatula', 'Oven'];
console.log(kitchenStuff[0]);
console.log(kitchenStuff[1]);
Frying Pan
Spatula

2. Arrays have a length that we can always access

https://codepen.io/joe_bacal/pen/QMEjwm?editors=0011

var kitchenStuff = ['Frying Pan', 'Spatula', 'Oven'];
console.log(kitchenStuff.length);
3

results matching ""

    No results matching ""