Skip to content

Instantly share code, notes, and snippets.

@aristretto
Created March 21, 2014 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristretto/17cb23f55fcc8e0bc990 to your computer and use it in GitHub Desktop.
Save aristretto/17cb23f55fcc8e0bc990 to your computer and use it in GitHub Desktop.
Array.prototype.clean
Array.prototype.clean = function(deleteValue) {
for (var i = 0; i < this.length; i++) {
if (this[i] == deleteValue) {
this.splice(i, 1);
i--;
}
}
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment