Fun with functions


#1

hi,there. I have no idea.whats wrong with it.someone can tell me?

function Person(job, married) {
this.job = job;
this.married = married;
// add a "speak" method to Person!
this.speak = function(){
console.log("Hello!");
};
}

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

Oops, try again. It looks like 'Hello!' wasn't logged to the console. Make sure that you properly defined the method and that you didn't change any of the provided code.


#2

the console should be in the user.speak parenthes


#3

There doesn't seem to be anything wrong with your code. It works for me.


#4

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