Last active
November 12, 2018 03:56
-
-
Save guangningyu/453d53361f78955f52b725dc856f2ccf to your computer and use it in GitHub Desktop.
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
// Filter object array based on attributes | |
var foo = [{'a':1, 'b':2}, {'a':2}, {'a':1}] | |
foo.find(o => o.a === 1) // return { a: 1, b: 2 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment