pushing element in array at specific 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 );
};