InsertAt is a very simple mixin for Underscore. The idea is to provide you with an easy way to insert items into an array at a specific index. This was something I threw together for some of my work on SPIN and thought I'd share it.
The function is easy enough to use.
var a = 'figs' 'ash' 'oreo';a = _;console; // ['figs', 'ash', 'mooch', 'oreo']
If you don't want to use Underscore (weirdo), you can just call the function insertAt().
To run tests, make sure you run
from within the directory to install development dependencies. Then run the following: