JavaScript Arrays - tdkehoe/blog GitHub Wiki

##Create an Array

var arr = [0, 1, 2];
var arr = ['a', 'b', 'c'];

##Access an Array

arr[1];

##Update an Array arr[1] = 'beige';

new Array(element0, element1[, ...[, elementN]])

Adding Items To an Array

colors[0] = "Red";
colors[1] = "Blue";

push() //Adds one or more items to the end of array and returns number of items in it

unshift()

###splice() to Remove and Add Elements To an Array

arr.splice()

This method enables removing and/or adding one or more elements to an array in a single command.