Sign in
Log inSign up

Create Array from Array of Objects

Maneesh Kumar's photo
Maneesh Kumar
·Aug 9, 2019

Looking for optimized solution for below program.

ArrayOfObj = [ {name: "XYZ" , age:30}, {name: "ABC" , age:30},{name: "ABC" , age:17},{name: "ABCD" , age:41},{name: "XYZ" , age:30}....... n objects ]

Now , I want to get the name(only) in array from all the objects whose age = 30 . output = ["XYZ", "ABC","XYZ" ........]