const menu = [{
name: "tofu fritters",
ingredients: ["tofu", "egg yolk", "breadbrumbs", "paprika"],
},
{
name: "black bean curry",
ingredients: ["black beans", "garam masala", "rice"],
},
{
name: "chocolate tiffin",
ingredients: [
"dark chocolate",
"egg",
"flour",
"brown sugar",
"vanilla essence",
],
},
{
name: "hummus",
ingredients: ["chickpeas", "tahini", "lemon", "garlic", "salt"],
},
];
searchResult = menu.some(menuItem => menuItem.ingredients === 'flour');
console.log(searchResult);
I was expecting this to return true since flour is present in the array for the third menu item but it returns false. Some() only seems to return true if I remove the array entirely from the object.