3/7 Short term memory


#1

It tells me the following: Oops, try again. Have you scanned eggs twice and magazine three times?
But I'm fairly sure that there's scan("eggs"); twice and scan("magazine") three times. Some help would be appreciated!

var cashRegister = {
total: 0,
//insert the add method here
add: function(itemCost){
this.total += itemCost;
},

scan: function (item) {
    switch (item) { 
    case "eggs": 
        this.add(0.98); 
        break;

    case "milk": 
        this.add(1.23); 
        break;

    //Add other 2 items here
    case "magazine":
        this.add(4.99);
        break;
    case "chocolate":
        this.add(.45);
        break;

    }
    return true;
}

};

//Scan 2 eggs and 3 magazines
scan("eggs");
scan("eggs");
scan("magazine");
scan("magazine");
scan("magazine");
//Show the total bill
console.log('Your bill is '+cashRegister.total);


#2

Oh, nevermind, I got it. I forgot the cashRegister. in front of the scans!