[javascript] Add bit about array mutability.

Closes #381.
This commit is contained in:
Adam Brenecki 2013-10-10 08:33:39 +10:30
parent d2ee4711a7
commit 9c0e7c548d

View File

@ -142,6 +142,10 @@ var myArray = ["Hello", 45, true];
// Array indices start at zero.
myArray[1]; // = 45
// Arrays are mutable and of variable length.
myArray.push("World");
myArray.length; // = 4
// JavaScript's objects are equivalent to 'dictionaries' or 'maps' in other
// languages: an unordered collection of key-value pairs.
var myObj = {key1: "Hello", key2: "World"};