mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-14 10:45:06 +02:00
@@ -142,6 +142,10 @@ var myArray = ["Hello", 45, true];
|
|||||||
// Array indices start at zero.
|
// Array indices start at zero.
|
||||||
myArray[1]; // = 45
|
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
|
// JavaScript's objects are equivalent to 'dictionaries' or 'maps' in other
|
||||||
// languages: an unordered collection of key-value pairs.
|
// languages: an unordered collection of key-value pairs.
|
||||||
var myObj = {key1: "Hello", key2: "World"};
|
var myObj = {key1: "Hello", key2: "World"};
|
||||||
|
Reference in New Issue
Block a user