var arr = []; arr.push("trot"); arr.push("prance"); arr.push("jog"); //['trot', 'prance', 'jog'] //remove prance arr.splice(1, 1); //['trot', 'jog']
//gets even numbers [1,2,3,4,5].filter(function(value, index, arr) { return value % 2 == 0; }); //[2,4]
//add 5 to each number [1,2,3,4,5].map(function(curVal, index, arr) { return curVal + 5; }); //[6,7,8,9,10]
By Ryan Lewis