Lesson 2: Fun with Functions


So I used the code below to add the speak function. "Hello" does print out in the box but the error still says that I did not log it to the console. I have tried refreshing but it is still the same. What am I doing wrong?

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

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


Just remember in an Object that you separate methods by commas " , " rather than semi-colons " ; ". So just change the semi-colons into commas and hopefully that should fix the error :smiley:

If not then pay close attention to the instructions and follow them word for word. Sometimes the console is expecting an EXACT response to pass the lesson.


console.log("Hello") :arrow_right: console.log("Hello!")

Notice the :exclamation:


Thanks guys! Debugging has never been my strong point :stuck_out_tongue:


I too was missing the "!"... Oh man I need more coffee