Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matheusmurta/a7517cd057de3a8a55060572fa7374ff to your computer and use it in GitHub Desktop.
Save matheusmurta/a7517cd057de3a8a55060572fa7374ff to your computer and use it in GitHub Desktop.
Javascript extract especif information from objects array
//Javascript extract especif information from objects array
var array = [ {"name":"Joe", "age":17, "sex":"M"},{"name":"Bob", "age":17, "sex":"M"},{"name":"Carl", "age": 35, "sex":"M"}];
array.map(x => ({
label: x.name,
value: x.age
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment