Created
February 22, 2018 17:45
-
-
Save adrianlemess/8d087c034966ae09de6da377e3120ec7 to your computer and use it in GitHub Desktop.
compare if object is in array
This file contains hidden or 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
| checkIfContains(arrayToCompare, objectToCompare, ...props) { | |
| return arrayToCompare.some(value => { | |
| return props.every(prop => value[prop] === objectToCompare[prop]) | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment