JavaScipt: Objects II, exercise 4. Can I See Your References?


Oops, try again. There was a problem with your syntax.
SyntaxError: missing formal parameter

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

// james' first job

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

// james' second job


at your method declaration:

sayJob: function(this.job)

why do you give the method a parameter of this.job?

member variables (job and married in this case) are automatically added to this, so you can access them in methods, so no need to supply a parameter

this also means, you can you remove the argument this.job from this line:



Ok, it makes sence.

So I made the changes. What is confusing that it shows I can go to "next lesson", but console is empty. (see screenshot below)


that is weird, your code is fine. I think your browser might be sending cached data. Try refreshing the page, then run your code again, see if you get output


It works now.

Thank you stemim94!