2/7 Manually Add It Up?


#1


Hello!
What's the problem? :confused:


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


//call the add method for our items
chashRegister.add(this.total);
cashRegister.add(0.98);
cashRegister.add(1.23);
cashRegister.add(4.99);
cashRegister.add(0.45);

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


#2

This line is causing the problem. It may be removed.


#3

The line "cashRegister.add(this.total)" is unnecessary.