in an array of objects, console.log names of people whose age >= 21
ChristyCarpente (0)

solved! I just used filter :) thank you!

I am trying to get my code to return an array of only the names of those in the array (stored as objects within the array) who are over 21 (can drink).
I have managed to get it to return the whole object for each person who is over 21, but I ONLY want the names. Can anyone steer me in the right direction?

You are viewing a single comment. View All
ChristyCarpente (0)

@ash15khng no I do not! I couldn't find my post again to update it. Thank you :)