I don't know why the information isn't being logged into the console


#1

I don't understand why the console isn't being logged?

Oops, try again. It looks like james' job was not logged to the console.

var james = {
    job: "programmer",
    married: false
};

// set to the first property name of "james"
var aProperty = "job";

// print the value of the first property of "james" 
// using the variable "aProperty"
console.log(james[aProperty]);

#2

The output of that code is:

programmer

If nothing is printed then you've probably done something previously to the environment (like having given console or console.log a different value so that it's no longer a function that prints


#3

After I reloaded the page the code ran perfectly. I am not sure exactly what made the console.log not show the output of
"programmer"
But it seems like you were correct. Thank you.


#4

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