Object Property Access Quiz
Question
Given `const user = { name: 'Ada', age: 36 };`, how do you access the name property?
Hint
JavaScript uses a dot to access object properties.
Explanation
In JavaScript, user.name accesses the name property of the user object using dot notation. user->name is PHP syntax, user[name] would need quotes (user['name']) for bracket notation, and user::name is used for static class members in some languages. Dot notation is the most common way to access object properties.
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.