Let Me See Your References (Intro to Objects II)


#1


There was another post on this board dated around 11/25 kinda addressing the same thing. Without really doing a f'n thing the lesson gave me the green light pass (I attempted the first step, NO effort towards the second (changing jame's job). Now I seem?? to have the correct answers from both what that user was shown and what I was shown the other night on the chat-box however, nada. Its telling me my method is not logging in anything. Neither function fires to put anything onto the black screen. Help! And thanks!!


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


#2

slightly updated code. (It passes me if I switch this.job value to just 'job' but it also tells me it 'cant find the variable job'. The error message I get now is that its not executing the console.log. Again,thanks!!

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

Umm, so I cut n paste my code onto my unofficial codecademy blackboard (earlier lesson I just practice stuff on) and everything executed just fine so...nevermind but maybe this lesson should be looked at cuz between me and the other guy, thats 2 cases where it passed us despite NO effort to its second instruction...as far as console.log. I couldn't get anything to come up, even just console.log('anybody home??') sort of bs.


#4

have you guys found the answer or what I also have problems with this question. here is my code below.

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

}

};

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

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


#5

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