4. Can I See Your References?


#1

Can I See Your References? Problem with the output.

Hello, what is wrong with my code?!
I`m getting the error below:


Oops, try again. It looks like your sayJob() method does not properly log 'Hi, I work as a [job]' 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

What's preventing you from resolving this, what do you need help with?
Do you agree with the error message, are you not printing out that message? Have you compared your output to what the instructions say, is there anything obviously different?


#3

Hi, i need help with my code.

I think the correct answers are these outputs:
Hi, I work as a programmer
Hi, I work as a super programmer

But my console is giving me this strange error:
Oops, try again. It looks like your sayJob() method does not properly log 'Hi, I work as a [job]' to the console.
And i don`t understand why??


#4

Ooh fixed it haha!

I didn`t read it well

i replaced " super programmer";

with 'super programmer';


#5
    console.log('Hi, I work as a' + this.job);

remove 'this' from the above line, hope it will help for you.
console.log('Hi, I work as a' + job);


#6

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