4. can i see your references


#1

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

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

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


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

I passed this but in console it says job is not defined.


#2

HI the method sayJob doesn't have a parameter so here

james.sayJob("super programmer");

you don't need to put "super programmer" inside () it shoudl just be

james.sayJob();

#Which should Output
Hi, I work as a programmer

then then they aske you to change james job to "super programmer"

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

#3

var james = {
job: "programmer",
married: false,
sayJob: function() {
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();
here is my code hope it helped you


#4

Its giving me error: SyntaxError: missing ) after argument list

var james = {
job: "programmer",
married: false,
sayJob: function() {
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();


#5

HI this line

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

its missing the + before this.job


#6

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