Object Property Access
Predict Output Easy
Question
What does this code print?
Code
let user = { name: "Ada", age: 30 };
console.log(user.name + " is " + user.age);
Hint
Access properties with dot notation.
Explanation
user.name is "Ada" and user.age is 30. The expression "Ada" + " is " + 30 first concatenates "Ada" + " is " = "Ada is ", then "Ada is " + 30 coerces 30 to "30" giving "Ada is 30". The output is: Ada is 30
Related Resources
Related Lessons
- Objects
Learn how objects work.
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.