How to Insert an Item Into an Array at a Specific Index in Javascript
Too Long; Didn't Read
Arrays are common data structures found in Javascript. They act a lot like arrays found in other languages, and are relatively easy to define. Sometimes we want to insert a new item into an array at a specific point. This is known as inserting an item into a specific index. In Javascript, this turns out to be quite an easy operation to perform. We use the 'splice' method, which is a simple function that takes 3 arguments - which also lets us delete items too.