Skip to content

Instantly share code, notes, and snippets.

@benjamincharity
Created June 12, 2018 13:23
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 benjamincharity/d872af01025502d7d124a4ef0ddef84b to your computer and use it in GitHub Desktop.
Save benjamincharity/d872af01025502d7d124a4ef0ddef84b to your computer and use it in GitHub Desktop.
removeByKey(array, params) {
array.some(function(item, index) {
if (array[index][params.key] === params.value) {
array.splice(index, 1);
return true;
}
return false;
});
return array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment