Skip to content

Instantly share code, notes, and snippets.

@listenrightmeow
Created April 20, 2012 01:28
Show Gist options
  • Save listenrightmeow/2425193 to your computer and use it in GitHub Desktop.
Save listenrightmeow/2425193 to your computer and use it in GitHub Desktop.
Extend JS natives
Array.prototype.remove = function(member) {
var index = this.indexOf(member);
index > -1 && this.splice(index, 1);
}
return this;
}
['one', 'two', 'three'].remove('two');
['four', 'five', 'six'].remove('three');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment