4. Can I See Your References? - What is wrong with this?



Can someone tell me what is wrong with my code, since it seems to print the right output to the console:

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

// james' first job
james.sayJob("super programmer");

// change james' job to "super programmer" here

// james' second job


Is the the sayJob function supposed to take in any argument? perhaps you should remove the arguments


job" and "sayJob" are listed as object properties for james. You use one object name "job" as an argument in another object name "sayJob"

==> this should be sayJob:function() and remove "this.job = job;" (no need).

//james' first job should be print "Hi, I work as a programmer"

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

//james' second job should be print "Hi, I work as a super programmer"


Why do we need to put "james.job" and not "this.job"? I did the latter and got it wrong until I saw this. Thanks.