Slide 100
Slide 100 text
var stuff = ["a", "b", "c"]
console.log(stuff[0]); // a
console.log(stuff[1]); // b
console.log(stuff[2]); // c
console.log(stuff.length); // 3
// Array's length and numerical properties are connected
stuff.push("d")
console.log(stuff.length); // 4
stuff["key"] = "value";
console.log(stuff); // [ 'a', 'b', 'c', 'd', key: 'value' ]
console.log(stuff.length); // 4!
delete stuff["key"];
console.log(stuff); // [ 'a', 'b', 'c', 'd' ]
stuff[4] = "e";
console.log(stuff); // [ 'a', 'b', 'c', 'd', 'e' ]
console.log(stuff.length); // 5
stuff = ["a", "b", "c"];
stuff[9] = "e";
console.log(stuff); // [ 'a', 'b', 'c', , , , , , , 'e' ]
console.log(stuff.length); // 10
100