Accessing Nested Object

Tell us what’s happening:
What is wrong with my code? I get an error stating “Use dot and bracket notation to access myStorage”.

Your code so far

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

// Only change code below this line

var gloveBoxContents =["inside"].glovebox; // Change this line
var gloveBoxContents =;

Your browser information:

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

Link to the challenge:

You were not supposed to change the glove box in the setup.

Now to access a value from a property with spaces (or some other punctuation), you’ll have to use bracket notation. Like inside['glove box'].

1 Like

var gloveBoxContents =[“glove box”];
LOl, thanks