Basic JavaScript - Accessing Nested Objects

Tell us what’s happening:
Describe your issue in detail here.
The below code returns assigns “maps” to the gloveBoxContents. However it does not pass the test. Please explain

  **Your code so far**
const myStorage = {
"car": {
  "inside": {
    "glove box": "maps",
    "passenger seat": "crumbs"
   },
  "outside": {
    "trunk": "jack"
  }
}
};

const gloveBoxContents =myStorage.car["inside"]["glove box"];
  **Your browser information:**

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

Challenge: Basic JavaScript - Accessing Nested Objects

Link to the challenge:

Well, I am a little bit confused with it myself.

You have this error message?

Your code should use dot and bracket notation to access myStorage.

As I see it, you are using both dot and bracket notation here, but still tests are not passing.

To pass the tests, you can use dot notation instead of bracket notation for ['inside']

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