5.Who's in Your Bracket?


#1



https://www.codecademy.com/en/courses/objects-ii/0/5?curriculum_id=506324b3a7dffd00020bf661



Oops, try again. Do you have the variable 'aProperty' between brackets?


I need some help


#2

Hi the instruction says
In line 7, set aProperty to a string of the first property in james (ie. the job property).
so you should do it like that

var aProperty = "job";

#3

It doesn't work.
Any other changes required?


#4

Can you post your new code?


#5

See the second line of the instructions:

Then print james's job using bracket notation and aProperty.

So, how'd you access james' job? By using james[_INSERT SOME VARIABLE HERE_]. the variable is aProperty, as you have already said in line 7 of your code. and then you have to print to console using proper function.


#6

https://www.codecademy.com/en/courses/objects-ii/0/5?curriculum_id=506324b3a7dffd00020bf661


#7

you should post it.. because with that link I see my code and not yours


#8


#9

Syntax error on line 3. Do you know why? :wink:

Also, requoting so you don't miss:


#10

Please forget that semicolon.
I still not get the reasons and rules of putting aProperty between brackets
Would you like to explain it in detail?


#11

We access any value from an object by using its corresponding key value. object[key] gives the value corresponding to key.

Now, the exercise wants the value corresponding to "job". It also wants you to use the variable aProperty (since you already defined aProperty = "job")

Can you do it now?


#12

I appreciated your time and effort.


#13

Were you able to complete the exercise?


#15

Yes I did it,thank you so much


#16

3 posts were split to a new topic: 5. Who's in your bracket?


#20