Created
November 7, 2017 08:20
-
-
Save KamMif/56ea2e929a4ab4dd8d7ed0b5980f358f to your computer and use it in GitHub Desktop.
find includes item in to array from obkect
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
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