I'm traversing through an object array:
people = [
{id:1, name:"Bob", available:false},
{id:2, name:"Sally", available:true},
{id:1, name:"Trish", available:false},
]
I want my output to be the names of those available:
["Sally"]
I currently know how to map and extract for a field. How do I add the conditional?
const peopleAvailable = people.map(person => person.value);
Want to do something like this:
const peopleAvailable = people.map(person.available => person.value);