Building a Cash Register 6


#1

Well, guys I really get stuck,
I don't get where is my mistake.

// create a constructor for the StaffMember class
var StaffMember ={
this.name : name,
this.discountPercent : discountPercent
}

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

//Create a StaffMember for yourself called me
var me = new StaffMember("me",20);

Error:
SyntaxError: missing : after property id


#2

// create a constructor for the StaffMember class
var StaffMember ={
this.name : name,
this.discountPercent : discountPercent
}

Should be:

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

The instructions did say create an object which had me confused, but the comments also note to create class.

Hope that helps!


#3

Thank you so much for your attention!