splice();

Last Updated on December 6, 2015

Splice takes three arguments.
1) where to start removing items
2) how many to remove (zero removes nothing)
3) what to insert
It changes the original array.

var arr = ["one", "two", "three", "four", "five", "six", 7, 8];
arr.splice(2, 2, "inserted 1", "inserted 2");
console.log(arr);
// Outputs: ["one", "two", "inserted 1", "inserted 2", "five", "six", 7, 8]