Object Property Quiz
Multiple Choice Easy
Question
After `const obj = {}; obj.x = 5;`, what is `obj.x`?
Hint
You can add properties to an object after creation.
Explanation
In JavaScript, you can add properties to an object at any time using dot notation. obj.x = 5 adds a property x with value 5 to the empty object. So obj.x is 5. This works even though the object was created empty with {}.
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.