I have to scan it more than once?


#1


https://www.codecademy.com/courses/close-the-super-makert/0/4?curriculum_id=506324b3a7dffd00020bf661#


var cashRegister = {
    total:0,
    add: function(itemCost){
        this.total += itemCost;
    },
    scan: function(item, num) {
        switch (item) {
        case "eggs": this.add(0.98 * num); break;
        case "milk": this.add(1.23 * num); break;
        case "magazine": this.add(4.99 * num); break;
        case "chocolate": this.add(0.45 * num); break;
        }
    }
};

// scan each item 4 times
cashRegister.scan("eggs", 4);
cashRegister.scan("milk", 4);
cashRegister.scan("magazine", 4);
cashRegister.scan("chocaolate", 4);


//Show the total bill
console.log('Your bill is '+cashRegister.total);


#2

There is a typo "chocaolate." When will I ever learn to type properly? sigh