Created
August 17, 2011 02:42
-
-
Save cyberstream/1150700 to your computer and use it in GitHub Desktop.
Insert an item into an array at the given zero-based offset, positive or negative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(i,o){r=this;o=(o==-1?r.length:(o<-1?o+1:o));return r.slice(0,o).concat(i).concat(r.slice(o,r.length))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment