Lesson 5 Introduction to Objects II Glitch?


#1

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

As far as i know this is exactly what they ask yet it tells me that it "programmer" wasn't printed onto the console. Is this some sort of glitch?


#2

I found a solution to this problem if other people are having it. Refresh the entire page and it should work i have no idea why it doesn't work before hand which was frustrating lol but that seemed to fix the glitch


#3

@textace92883,
No space between the console.log and the opening-parenthesis-(
like your

console.log (james[aProperty]);

should have been

console.log(james[aProperty]);

#4

Thank you for this. Worked for me i literally didnt change any code just refreshed the page. Odd..