// The original array var array = ["one", "two", "four"]; // splice(position, numberOfItemsToRemove, item) array.splice(2, 0, "three"); array; // ["one", "two", "three", "four"]
Array.prototype.insert = function (index, item) { this.splice(index, 0, item); };
References
https://davidwalsh.name/array-insert-index