5 Who's in Your Bracket?


#1



This is my code

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" 
console.log(james.job);
// using the variable "aProperty"
console.log(james[aProperty]);

All it returns to me is "
Oops, try again. It looks like james' job was not logged to the console"
Please help.


#2

@masha.tsuria1gmail.c

You should log james' job with the variable aProperty. Do not log it directly using james.job

Remove this line


#3

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


#4

i used ur code but it gives same error "
Oops, try again.
It looks like james' job was not logged to the console.
"


#5

Thank's everyone but i actually found out what was my problem... But thanks anyway!!!!!!


#6

so what was the problem , I'm kind of little lost


#7

Well I solved like 2 days ago so I don't really remember....


#8

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

this code is correct
You should reload your page and try again with the same code


#9

thank you for the reload browser tip, saved me a lot of time.


#10

That was so ridiculously stupid. "Reload the page" actually worked. Thanks for that - I don't know how many different ways I tried before realizing reloading was the problem. That's the problem when you're relatively new - you don't know if the problem is your code or codecademy...


#11

It was just a bug. This happened to me too!
:sweat_smile::wink:


#12

cant't believe i had to reload my page for it to work LOLLOL


#13

I'm so mad right now. I sat there for an hour looking for a typo, rewriting every line. I just figured I had messed up somewhere. Then I check this and I see "reload the page" and of course that worked.

An hour of my life that I will never get back. Thanks, codeacademy.


#14

wtf..thanks man i reload the page and it works.


#15

freaking bug! .. was so annoying


#16

Here was my problem

james[aProperty]);

was logging - "programming"

i changed it to

console.log(james[aProperty]);

and it finally logs - programming...

Correct me if I'm wrong but calling james[aProperty] pulls the full string as written and c.logging it takes the information from the string and posts it... Right?


#17

Thanks it worked ...