Skip to content

Instantly share code, notes, and snippets.

@KamMif
Created November 7, 2017 08:20
Show Gist options
  • Save KamMif/56ea2e929a4ab4dd8d7ed0b5980f358f to your computer and use it in GitHub Desktop.
Save KamMif/56ea2e929a4ab4dd8d7ed0b5980f358f to your computer and use it in GitHub Desktop.
find includes item in to array from obkect
const values = ['sadasdasd', 'sdfsdfsdf', 'sdfsdf'];
const obj = [{ id: 1, transaction: 'sdfsdf' }];
const sorted = values.filter(value => obj.map(item => item.transaction).includes(value));
console.log(sorted);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment