JavaScript penyisipan array
Array.prototype.insert = function ( index, item ) {
this.splice( index, 0, item );
};
Relieved Rook
Array.prototype.insert = function ( index, item ) {
this.splice( index, 0, item );
};
var list = ["foo", "bar"];
list.push("baz");
["foo", "bar", "baz"] // result