Created
August 31, 2017 10:09
-
-
Save 4mitch/96aef7809bd1bbd544b87fa9f29cd0ae to your computer and use it in GitHub Desktop.
Find uniq values of property in array of objects
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
var array = [ | |
{ name: "Joe", age: 17 }, | |
{ name: "Bob", age: 17 }, | |
{ name: "Carl", age: 35 } | |
]; | |
console.log(new Set( array.map((obj) => obj.age)) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment