2. Fun with functions


#1

"Oops try again, looks like "Hello" wasn't logged to the console". What's the problem here? Thanks

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

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


#2

It mentions "Hello", where would that come from?


#3

Ah silly me. Thank you though!


#4

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