Skip to content

Latest commit

 

History

History
46 lines (26 loc) · 616 Bytes

File metadata and controls

46 lines (26 loc) · 616 Bytes

Arrays

/**
 * Create an array
 */
var fruits = ["orange", "apple", "banana", "pear"];

console.log(fruits[0]);
console.log(fruits[1]);
console.log(fruits[2]);
console.log(fruits[3]);


/**
 * Write out array length
 */

console.log(a.length);


/**
 * Write out the keys in the array
 */

console.log(Object.keys(fruits));

Reference and read more

MDN Arrays

Revision history

2014-06-03 (sylvanas) PA1 First try.