1.) array.push - Adds one or more elements to the end of an array and returns the new length of the array.2.) array.shift - Removes the first element from an array and returns that element.3.) array.splice - Adds and/or removes elements from an array.4.) array.slice - Extracts a section of an array and returns a new array.5.) array.toString - Returns a string representing the array and its elements. Overrides the Object.prototype.toString method.
myFish.splice(2, 0, "drum");
Currently I'm having to mess with array.push() and am wondering what it does.
var alphabet = ["a", "b"];
alphabet[0] == "a"alphabet[1] == "b"alphabet.length == 2
alphabet.push("c")
alphabet[0] == "a"alphabet[1] == "b"alphabet[2] == "c"alphabet.length == 3
alphabet.splice(2, 0, "d");
alphabet[0] == "a"alphabet[1] == "b"alphabet[2] == "d"alphabet[3] == "c"alphabet.length == 4
alphabet.splice(0, 2);
alphabet[0] == "d"alphabet[1] == "c"alphabet.length == 2
var characters = [];characters.push(new Player("hero"));characters.push(new Player("sidekick"));