Skip to content

Instantly share code, notes, and snippets.

@mauromarano
Created May 7, 2013 15:51
Show Gist options
  • Save mauromarano/5533693 to your computer and use it in GitHub Desktop.
Save mauromarano/5533693 to your computer and use it in GitHub Desktop.
Search and remove an item from an array
var remove = function(array, value) {
var index = null;
while ((index = array.indexOf(value)) !== -1)
array.splice(index, 1);
return array;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment