Last active
November 10, 2017 12:54
-
-
Save KamMif/dbe38b59711e8efebfb23572d3b6cc0f to your computer and use it in GitHub Desktop.
find includes in array and output filtred object
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
const values = ['sadasdasd', 'sdfsdfsdf', 'sdfsdf']; | |
const obj = [{ id: 1, transaction: 'sadasdasd' }]; | |
const sorted = obj.filter(item => item.transaction.indexOf(values.transaction) !== -1); | |
console.log(sorted); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment