I have an array,
const array = [
{
name: G1,
male: true,
female: false
},
{
name: G2,
male: false,
female: true
}]
Now in this, i need to filter or fetch name=G1, and then i need to check if male is true or female is true ? And the output as Male or Female ?
I tried ;
array.filter(e => e.name === "G1" && (e.malesSeat === true || e.ladiesSeat === true))
This gives, result but how to know which is true as Male or Female ?
Expected Result:
Male === true or just Male
As for G1, only Male is true!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…