Accessing Nested Objects using dot or bracket notation

Accessing Nested Objects using dot or bracket notation
0.0 0

#1

Tell us what’s happening:
I’ve tried many iterations for this code problem.
Original problem said:
var gloveBoxContents = “”; // Change this line

Plz help

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.inside["glove box"] // Change this line

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36.

Link to the challenge:


#2

Sorry forgot to add details to problem

Instructions
Access the myStorage object and assign the contents of the glove box property to the gloveBoxContents variable. Use bracket notation for properties with a space in their name.


#3

What does the failing test say?


#5

Nvm I figured it out lol

It was var gloveBoxContents = myStorage.car.inside[“glove box”];