Intro to Objects II


#1

Heres my code:

function Person(job, married) {
this.job = job;
this.married = married;
this.speak = function(){
console.log("Hello!")
};
}

var user = new Person("Codecademy Student",false,);
user.speak();

I have read previous posts on this, have tried their suggestions, and nothing seems to work. HELP!


#2

Please post a link to the exercise, as well as any error message(s) you are getting. Thank you.


#3

Hi. If I understand it, here's the link - https://www.codecademy.com/courses/objects-ii/0/2?curriculum_id=506324b3a7dffd00020bf661. It is Intro to Objects II Fun with Functions. The 'Fun' part is surely a dark joke!

At the moment the error says:
SyntaxError: expected expression, got ')'.
Before that it was SyntaxError: expected expression, got '}'.
Before that the error said "Hello!" was not outputting. Frankly I've lost track of all the different error messages from what should be a very basic exercise. This has been a progression of error messages. When I make a change I might lose the previous error, but I get a new error. Very frustrating.
Thanks for looking.


#4

Remove the stray comma after, false. That's the only error I can see.


#5

Thank You! All that hair pulling for one stray comma - ARGHHHHHH! I don't know why you're here helping, but BIG THANKS!