4. Can I see your references?


#1


https://www.codecademy.com/en/courses/objects-ii/0/4?curriculum_id=506324b3a7dffd00020bf661


The error message I am getting says
"Oops, try again. It looks like your sayJob() method does not properly log 'Hi, I work as a [job]' to the console"
however, it is working and logging to the console


var james = {
    job: "programmer",
    married: false,
    sayJob: function() {
        // complete this method
        console.log("Hi, I work as a  " + this.job);
    }
};

// james' first job
james.sayJob();

// change james' job to "super programmer" here
james.job = "super programmer";

// james' second job
james.sayJob();


#2

Here is my code:

var james = {
    job: "programmer",
    married: false,
    sayJob: function() {
        console.log("Hi, I work as a "+this.job);
    }
};

// james' first job
james.sayJob();

// change james' job to "super programmer" here
james.job = "super programmer";

// james' second job
james.sayJob();

#3

Your code is correct. There are two spaces after I work as a and that is why codecademy thinks that output is not right.

console.log("Hi, I work as a " + this.job);

#4

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