Predict Object Property Access
Predict OutputBeginner
Question
What does this code print?
Code
const book = { title: "Dune", pages: 412 };
console.log(book.title);
Hint
Dot notation accesses the value stored at that key.
Explanation
The object book has a title property with the value "Dune". Using dot notation book.title retrieves that value, so console.log prints: Dune
Related Resources
Related Lessons
- JavaScript Objects
Learn how to access object properties.
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.