4/30 can i see your references


#1

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

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

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

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

kindly help me with this

moving to the next exercise but also giving an error in display box "ReferenceError: job is not defined"

how to define job here????


#2

In the given code there is no constructor, you have an object; that means using the "this" keyword will not do anything, you will just have to change the property of an object (objectName.objectProperty).


#3

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

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

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

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

now it says job is not defined


#4

I think it may help you......

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();