const products = [{name :"a", quantity:5}, {name :"c", quantity:3} ] make a function to find by name and increment the quantity. Must be imutable. Must return the updated products array.
function findAndUpdate(products, name){ return products.map(function(product){ if (product.name === name){ product.quantity += 1; } return product; }); }