push index number in an array in JS code example
Example 1: js array add element
array.push(element)
Example 2: javascript push in specific index
arr.splice(index, 0, item);
//explanation:
inserts "item" at the specified "index",
deleting 0 other items before it