Skip to content

Instantly share code, notes, and snippets.

@wkronemeijer
Created October 23, 2013 15:20
Show Gist options
  • Save wkronemeijer/7120728 to your computer and use it in GitHub Desktop.
Save wkronemeijer/7120728 to your computer and use it in GitHub Desktop.
Removes all instances of a element in an array
Array.prototype.remove = function (element) {
while (this.contains(element)) {
this.splice(this.indexOf(element), 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment