4.can I see your references?


#1


I have no idea what I did wrong. got this message : ReferenceError: job is not defined

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

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

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

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

#2

All you need to add is this. referring to the owner of the function,

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


#3

sayJob: function() {
   // complete this method
   console.log('Hi, I work as a' + this.job);  
}

#4

change this line

thi this

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

and make sure to refresh page before doing this ..


#5

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