4. Can i see your references? [SOLVED]


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

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

// change james' job to "super programmer" here
james.sayJob("super programmer");

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

What is wrong with my method?


#2

Try to use this code:
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();


#3

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

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

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

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

Why this error ? Oops, try again. It looks like your sayJob() method does not properly log 'Hi, I work as a [job]' to the console


#4

Your code is: " Hi, I work a "

But it should be: "Hi, I work as a "