Accessing Nested Objects - clarification

Tell us what’s happening:

If the key “glove box” was “gloveBox” then I could have done or myStorage[“car”][“inside”][“gloveBox”] and got the right answer right?

Your code so far

// Setup
var myStorage = {
  "car": {
    "inside": {
      "glove box": "maps",
      "passenger seat": "crumbs"
    "outside": {
      "trunk": "jack"

var gloveBoxContents =["glove box"]; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:

Correct. You can only use dotted notation when the prop key is known, and is a string

1 Like

Just to clarify, it’s slightly more restrictive than that: It needs to be a valid “JavaScript identifier”, meaning that it can be made up of alphanumerical characters, underscores, and dollar signs but can’t start with a number. That is different than the JS concept of a “string”.