Accessing Nested Objects, i am stuck here

Accessing Nested Objects, i am stuck here
0

#1

Tell us what’s happening:
please help i am instructed to access the property of glove box “maps” using bracket notation and space.

Your code so far

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

// Only change code below this line
myStorage.car["glove box"].maps; 
var gloveBoxContents = " maps"; // Change this line

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

Link to the challenge:


#2

You’re really close, your missing an object after car. Also look again at the example given.


#3

thanks, i add car.inside[“glove box”].maps // still i can’t pass the challenge


#4

“maps” is a value of the “glove box” property. To access a value, you only need to reference the property. To access the “glove box” property, you just take off the .maps at then end of what you are currently trying to do.

The final solution will only be one line of code that looks like:

var gloveBoxContents = myStorage.something1.something2["something3"];

#5

thanks for your help, but still i can’t make it. here is the screen shot