Accessing Nested Objects 5

Tell us what’s happening:

I need help urgently

Your code so far


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

var gloveBoxContents = "maps"; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects/

What seems to be the problem? Have you tried writing any code, no need to be shy, you can show us - that will help us understand the part where you need to help / the concept or the technique that you don’t understand.

Its looking for the path to access the property. You can use dot notation for most of it, but I had to switch to brackets for the parameter with a space.

You are right, you have to use brackets when you are using property names with spaces in them or if you want to use variables instead of strings to access your properties. In this situation all you have to worry about is strings, so no need to concern yourself with variables at this point.

So, what have you got so far? Show us your code :slight_smile: Just giving you the answer will not help you one bit, you have try to solve this yourself first. You got all the info you need, read the instructions to the challenge one more time.