3 - Short-Term-Memory


#1



3-Short-Term-Memory


Hello, Can someone help me to know what is the problem with my code?

Here it is Error Message:
SyntaxError: missing } after property list


var caisse = {
    total:0,
    ajouter: function(coutElement) {
        this.total += coutElement
    };
    
    scan: function(element) {
        switch (element) { 
        case "oeufs": 
            this.ajouter(0.98); 
            break;
        
        case "lait": 
            this.ajouter(1.23); 
            break;
        
        case "magazine":
            this.ajouter(4.99);
            break;
        
        case "chocolat":
            this.ajouter(0.45);
            break;
        }
        return true;
    }
};

caisse.scan("oeufs");
caisse.scan("oeufs");
caisse.scan("magazine");
caisse.scan("magazine");
caisse.scan("magazine");

// Affichez le total
console.log('Votre total est de ' + caisse.total);


#2

That should be a semicolon? Are you sure? Im sure your smarter!


#3

Ow it's too stupid, thank you it works but in the instructions they say "don't forget to add a semicolon after your add function" that's why i put it.


#4

It says "don't forget that a comma (,) will be needed after closing the new add method"

I literally just did the same thing haha.