Can I See Your References?


Error message I am receiving:
Oops, try again. It looks like you did not change james.job to 'super programmer' on line 14.

Can someone explain what is wrong with my code?

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

// james' first job

// change james' job to "super programmer" here
james.sayJob("super programmer");

// james' second job


You need to change his job rather than call on the method sayJob. For example...

james.job = "super programmer";

Your way would work to print out that he is a super programmer, but your not actually changing his job title in the object. Thats why when you call sayJob a second time, it would repeat what his job was before, in this case being a "programmer" . Hope this helps!


Thank you. The problem was solved :grin: