4. Can I See Your References?


#1

Hey, what's wrong me this code?
(It says : Oops, try again.
It looks like your sayJob() method does not properly log 'Hi, I work as a [job]' to the console)

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


#2

@s.purpose,
Add a space-character

"Hi, I work as a "


#3

@ leonhard.wettengmx.n Thanks it works!


#4

Please check i am getting the same error message:

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


#5

@abhinav228,
Remove a space-character

"Hi , I work as a "

"Hi, I work as a "


#6

@leonhard.wettengmx.n Yeah it is working now but it is not showing logged content in console which was showing earlier. Big Thanks for your help :slight_smile:


#7

Its executing but output is not displaying anything.


#8

@jatlavivek

Have you tried a reset Browser

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom