This is basically the example in the “Accessing Nested Objects Lesson”
I just have a question as to why the bracket notation “” is on the “top drawer”?
I was wondering why we can choose bracketing the “cabinet” or “folder1”?
Thank you very much.
In other words, what exactly is the selecting in this process?
Your code so far
"desk": {
"drawer": "stapler"
},
"cabinet": {
"top drawer": {
"folder1": "a file",
"folder2": "secrets"
},
"bottom drawer": "soda"
}
};
ourStorage.cabinet["top drawer"].folder2;
ourStorage.desk.drawer;
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0
Challenge: Basic JavaScript - Accessing Nested Objects
Link to the challenge: