Can I see your references? I need a better understanding


How come you have to change James's job like this [ james.job="super programmer"; ] (without the brackets). Why couldn't we just use the [ james.sayJob( ); ] to change his job. I thought that was the point of the function. Any clairifcation would be appericated!

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

// james' first job

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

// james' second job


you can update a property (job) of an object (james) by doing using the following syntax:

objectName.popertyName = "new value"

the purpose of the sayJob method is to tell which job james is doing, not to update the job.


Thank you for your response :grin: