4.7 Cash Register problem "cashRegister is not defined"


I'm working on building a cash register : https://www.codecademy.com/courses/close-the-super-makert/0/4?curriculum_id=506324b3a7dffd00020bf661#

I'm getting this error from the console: ReferenceError: cashRegister is not defined

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

// scan each item 4 times

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


The error message is actually referencing the above line, and reads as,

ReferenceError: cashRegsiter is not defined


Ah, such a simple typo. Thanks!!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.