7 - You Deserved It! Help


#1


https://www.codecademy.com/pt-BR/courses/javascript-beginner-pt-BR-xqkwz/0/7?curriculum_id=5355c2d8516bcbd912000009


I keep getting this message:
SyntaxError: missing } after property list
But I can't see where is the missing }.
Can someone help me?
Thank You!

function StaffMember(name,discountPercent){
    this.name = name;
    this.discountPercent = discountPercent;
}

var sally = new StaffMember("Sally",5);
var bob = new StaffMember("Bob",10);

// Crie a si mesmo como 'me' com um desconto de funcionario de 20%
var me = new StaffMember("Sue",20);

var cashRegister = {
    total:0,
    lastTransactionAmount:0,
    add: function(itemCost){
        this.total += (itemCost || 0);
        this.lastTransactionAmount = itemCost;
    },
    scan: function(item,quantity){
        switch (item){
        case "ovos": this.add(0.98 * quantity); break;
        case "leite": this.add(1.23 * quantity); break;
        case "revista": this.add(4.99 * quantity); break;
        case "chocolate": this.add(0.45 * quantity); break;
        }
        return true;
    },
    voidLastTransaction : function(){
        this.total -= this.lastTransactionAmount;
        this.lastTransactionAmount = 0;
    },
    // Crie aqui um novo método applyStaffDiscount
    applyStaffDiscount : funtion(employee) {
        this.total -= this.total * (employee.discountPercent / 100);
    }
};

cashRegister.scan('ovos',1);
cashRegister.scan('leite',1);
cashRegister.scan('revista',3);
// Aplique seu desconto de funcionário passando o objeto 'me' 
// para applyStaffDiscount
cashRegister.applyStaffDiscount("me");

// Mostre o total da conta
console.log('Sua conta é '+cashRegister.total.toFixed(2));


#2

HI this line

applyStaffDiscount : funtion(employee)

you wrote funtion instead of function


#3

I fixed it, but now it shows: "Oops, try again. false"


#4

This line

cashRegister.applyStaffDiscount("me");

you should remove the " " arounf me becuase it make it a string......But you wan to use the me object


#5

It worked! Thank you!


#6

thank you ! it worked for me .


#7

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