add item to list js at index code example
Example 1: insert item into array specific index javascript
myArray.splice(index, 0, item);
Example 2: array insertion javascript
Array.prototype.insert = function ( index, item ) {
this.splice( index, 0, item );
};