Skip to content

Instantly share code, notes, and snippets.

@ernestohs
Last active December 24, 2015 17:39
Show Gist options
  • Save ernestohs/6837527 to your computer and use it in GitHub Desktop.
Save ernestohs/6837527 to your computer and use it in GitHub Desktop.
Array.remove for Javascript #ExtendingJavaScript
if (!Array.prototype.remove) {
Array.prototype.remove = function () {
var what, args = arguments, length = args.length, item;
while (length && this.length) {
what = args[--length];
while ((item = this.indexOf(what)) !== -1) {
this.splice(item, 1);
}
}
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment