How to explain the function what value we passed?
Object passed this type
obj = { "Апельсины": {"price": 4,"kolvo": 2},"Бананы": {"price": 2,"kolvo": 0} } But will bring the result with the price and quantity
var items = { "Апельсины": { "price": 4, "kolvo": 2 }, "Бананы": { "price": 2, "kolvo": 0 } }; notification(items, (kolvo) => kolvo === 2) function notification(items, condition) { for (const name in items) { let price = items[name].price let kolvo = items[name].kolvo if (condition(price)) { console.log(name + price) } else if (condition(kolvo)) { console.log(name + kolvo) } } }