Last active
December 13, 2015 19:08
-
-
Save tcelestino/4959890 to your computer and use it in GitHub Desktop.
Remove item for array - by Andrey Knupp (https://github.com/andreyknupp)
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
Array.prototype.remove = function(i) { | |
var index; | |
if( ( index = this.indexOf( i ) ) !== -1 ) { | |
this.splice( index , 1 ); | |
} | |
return this | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment