Skip to content

Instantly share code, notes, and snippets.

@adrianlemess
Created February 22, 2018 17:45
Show Gist options
  • Select an option

  • Save adrianlemess/8d087c034966ae09de6da377e3120ec7 to your computer and use it in GitHub Desktop.

Select an option

Save adrianlemess/8d087c034966ae09de6da377e3120ec7 to your computer and use it in GitHub Desktop.
compare if object is in array
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