mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
parent
d2ee4711a7
commit
9c0e7c548d
@ -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"};
|
||||
|
Loading…
Reference in New Issue
Block a user