6/7 Over the Moon

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
I keep receiving “SyntaxError: Expected ‘;’” and I can not figure out where it would be looking for a ‘;’ at.

```

// create a constructor for the StaffMember class
var StaffMember (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(“Robert”,20);

<do not remove the three backticks above>

When declaring an Object in JavaScript, you use the keyword function not var. So, in your case, the correct code will be

function Staffmember {
/YOUR CODE/
}

And me, bob and sally will stay the same.

Regards,
Barry Allen

1 Like

agh thank you, so simple yet I must have skipped it over 10 times. cheers.

No worries…

Regards,
Barry Allen

this.name=name,
this.discountPercent=discountPercent,
Also, these lines should end with a semicolon not colon…try that.

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