I have an array and inside i have a group of objects and how would i loop through them and to make a check for which one of the objects have a status as true?
menuItems: [
{
text1: 'Apple',
status: false,
subItems: []
},
{
text2: 'Orange',
status: false,
subItems: []
},
{
text3: 'Banana',
status: true,
subItems: []
}
]
I tried something like this:-
if(menuItems.forEach(active) === 'false') {
then('do something!!!')
}