6. Over the Moon


#1

https://www.codecademy.com/courses/close-the-super-makert/0/6?curriculum_id=506324b3a7dffd00020bf661#

I could swear my code is correct, yet keep getting the error
"SyntaxError: missing before statement"

// create a constructor for the StaffMember class
var StaffMember=function(name, discountPercent) {
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("Jessica",20);

#2

Here's the constructor:

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

You have a colon instead of an equals sign there. Though I believe yours is correct, it does want this method. Hope this helps.


#3

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