5.Who's in Your Bracket?



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

I need some help


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";


It doesn't work.
Any other changes required?


Can you post your new code?


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.




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



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

Also, requoting so you don't miss:


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?


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?


I appreciated your time and effort.


Were you able to complete the exercise?


Yes I did it,thank you so much


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