Tell us what’s happening:
i cant solve test 7;addproduct thing …but the output is ok
Your code so far
let inventory=[]
function findProductIndex(name){
let low=name.toLowerCase();
let index=inventory.findIndex(obj => obj.name === low);
return index
}
console.log(findProductIndex('flour'));
function addProduct(value){
let low=value['name'].toLowerCase()
if(low === 'flour'){
return value['quantity'] + ',' + '5'
}
}
console.log(addProduct({name: "FLOUR", quantity: 5}));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Challenge Information:
Build an Inventory Management Program - Build an Inventory Management Program