Created
June 12, 2018 13:23
-
-
Save benjamincharity/d872af01025502d7d124a4ef0ddef84b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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