var gloveBoxContents = myStorage.car["inside"].glovebox;
You only need bracket notation in two cases:
The property name is stored in a variable.
The property name is not a valid JS identifier (make up of letters, numbers, _, or $ and does not start with a number).
The first case is not an issue here, but we do have an issue with “glove box” - it is not a valid JS identifier because it has a space in it. You need to do what you did for “inside” for this property. But the “inside” property should just be dot notation.
That is closer. But you still have the problem with the “glove box”. The property name has a space in it, but you’ve done it as if it is a variable name. So, to make sure it hits the property in the array, it needs to be a string and that space needs to be in there.
You’re not the first to be confused by this. I used to work next two a couple junior devs that seemed constantly confused about this. I think as long as you understand what a valid JS identifier is and understand the two use cases I mentioned, it becomes clearer.