Change:
Based on and others like it, I am wondering if we should slightly modify the instructions for the challenge. The last test is written to only accept a solution were the properties "car" and "inside" must use dot notation and the "glove box" property (of course) has to use bracket notation. The instructions only state the camper to use bracket notation on the "glove box", but does not make it clear bracket notation can not be used on "car" and "inside". Many campers don't understand why their solution (which would technically get the "glove box" property's value) fails the last test. With the current instructions, all three of the following should be accepted because the only real requirement in the current instructions is "Use bracket notation for properties with a space in their name." Since it is a "best practice" for more readable code to use dot notation where possible, I am wondering what others think about changing the instructions to something like the following: This way the existing test can be used and the camper gets to use the knowledge they have already obtained from previous lessons (i.e. properties with spaces need bracket notation) without us explicitly telling them to use bracket notation (which felt a bit like hand-holding to me).
Seems good to me. It should help them realise that they need both forms without straight up telling them the answer.
I'm actually not a fan of this. I don't like when valid code will fail - I think it can get people thinking their method is wrong when it is actually correct - I would rather see something like it is and maybe just add a note about how using the dot is best practice when applicable. - my two cents edit: after taking a second look - I think it would be fine to go either way here. Many of the other challenges in this area force a certain syntax.
When possible, we try to imply "best practices" without just coming out and saying it is a "best practice". If we don't care about teaching a "best practice", then I have already written the necessary to allow all three of the following: I would be comfortable in doing this too, but I lean slightly towards my other idea for two reasons: to use dot notation possible over bracket notation promotes better code readability. users to think about alternative ways of accessing object properties (not just using bracket notation for everything) gets the users out of their comfortable zone.
I've thought about this a little more and I think just changing the instructions is the way to go. Requiring campers to use both dots and brackets serves as a nice reminder that both forms of notation work. Since this lesson appears a little bit after they're introduced, it should serve as useful reinforcement. Ordinarily I prefer fairly permissive tests, but the strictness has a use here.
Hey , I think it's a good idea. Can I take this up to make my first contribution(PR) to freecodecamp?
Go for it. It is all yours. Let us know if you have any questions. For fastest replies, visit our .
I was one of the folks who was confused by this and posted on the forum so I'm definitely in favor of a change. Either making bracket notation a valid solution when it is indeed valid for the code to work, or indicating that FCC requires dot notation unless the outcome requires bracket notation (string with space/variable). I am curious why FCC doesn't state 'best practices'. Not a criticism at all, just wondering. I obviously hadn't picked up that is was implied that dot notation should take precedence over bracket if they serve the exact same purpose in that particular situation. FWIW I found that helped a lot but not sure FCC wants to start linking to codeburst.
I wonder what about the changes in other languages?
Don't worry about the other languages. We are no longer translating the current curriculum challenges.
I submitted a PR for the update by following the contribution guidelines.

Discussion:
## Instructions <section id='instructions'> <del> Access the <code>myStorage</code> object and assign the contents of the <code>glove box</code> property to the <code>gloveBoxContents</code> variable. Use bracket notation for properties with a space in their name. </del> <ins> Access the <code>myStorage</code> object and assign the contents of the <code>glove box</code> property to the <code>gloveBoxContents</code> variable. Use dot notation for all properties where possible, otherwise use bracket notation. </ins> </section> ## Tests