bamazonCustomer.js
// for loop, looping through each item in the inventory. confirming the ID actually exists in our inventory
for loop, looping through each item in the inventory. confirming the ID actually exists in our inventory
for loop looping through each item in the inventory . confirming the ID actually exists in our inventory
function checkInventory(choiceId, inventory) {
    for(var i=0; i < inventory.length; i++) {
        if (inventory[i].item_id === choiceId) {
            return inventory[i];
        }
    }
    return null;
}
function checkInventory ( choiceId , inventory ) { for ( var i = 0 ; i < inventory . length ; i ++ ) { if ( inventory [ i ] . item_id === choiceId ) { return inventory [ i ] ; } } return null ; }
for loop, looping through each item in the inventory.
for loop looping through each item in the inventory .