Arrays

var arrayA = [1, 2]; var arrayB = new Array(1, 2); arrayB.push(3); // arrayB is [1, 2, 3] arrayB.pop(); // returns 3 arrayB.unshift(3); // arrayB is [3, 1, 2] arrayB.shift() // returns 3
Back to presentation