Is there a way to see if an item is located in a dictionary values.
My attempt:
var inventory_needed = [
{ section: "hardware", supplies: "hammers" },
{ section: "plumbing", supplies: "pipes" },
{ section: "garden", supplies: "grass seeds" },
{ section: "cleaning supplies", supplies: ["hand sanitizer", "detergent"] },
{ section: "appliances", supplies: ["fridges", "dishwashers"] }
];
incoming_item = "hand sanitizer";
inventory_needed.forEach(function(item) {
if(item.supplies.includes(incoming_item)) {
console.log(incoming_item + 'is on the way');
}
else{
console.log('nothing is on the way');
}
}