Created
April 9, 2014 20:01
-
-
Save scrubmx/10308629 to your computer and use it in GitHub Desktop.
Remove an element from an array
This file contains hidden or 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
| Array.prototype.remove = function (itemToRemove) | |
| { | |
| return this.filter(function (element) { | |
| return element !== itemToRemove; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment