Nested Object Access
Multiple Choice Medium
Question
Given `const data = { user: { profile: { name: 'Ada' } } };`, how do you get 'Ada'?
Hint
Follow the nesting chain: data → user → profile → name.
Explanation
To access a deeply nested property, chain the dot notation through each level: data.user.profile.name. Each dot goes one level deeper. Skipping levels (like data.profile.name) would fail because profile is inside user, not directly on data.
Related Resources
Related Lessons
- Objects
Learn how objects group related data with keys and values.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.