2. Manually Add It Up? What's wrong with it?


#1



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


It says that 'add' isn't defined.


var cashRegister = {
    total: 0,
    add: function(itemCost){
        this.total += itemCost;
    }
};

//call the add method for our items
add(0.98);
add(1.23);
add(4.99);
add(0.45);

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

please help,

here's an image:


#2

Hi try it like that

cashRegister.add(0.98);
....

#3

Lightspeed reply!
THANKS,
...feel a little dumb now