Object Property with bracket and dot notation test failure

Tell us what’s happening:
Describe your issue in detail here.
I am using dot notation as well as bracket notation. Why does not it passes the tests?

  **Your code so far**

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

var gloveBoxContents = myStorage.car.inside.["glove box"]

  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: Accessing Nested Objects

Link to the challenge:

Hi @kick933 ,


myStorage.car.inside.["glove box"]

If you are using the bracket notation, it doesn’t need to be preceded by a dot!

You may want to revisit the challenges on dot and bracket notation.

I am confused as to why first test is passing since i used dot notation mixed u pwith bracket notation?

That is a good question. It really should throw a syntax error.

Uncaught SyntaxError: Unexpected token '['

As far as I can tell, it has to do with the code transpilation (Babel). If I add the code to the Babel repl it removes the dot. Not really ideal in a learning environment.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.