Created
November 19, 2013 08:44
-
-
Save jpetitcolas/7542241 to your computer and use it in GitHub Desktop.
Array manipulation in Javascript
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
// Remove an element at desired index | |
a.splice(desiredIndex, 1); | |
// Add an element at given index | |
a.splice(desiredIndex, 0, "My new element"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment