How to insert an item into an array in Javascript
The standard way to insert an item into an array is to use splice (opens new window) and provide the item your want to insert as the third argument. The first argument is the specific index where you want to insert the item and the second argument should be set to 0
since we're not removing anything from the array.
JS
Copy code