Optional Chaining Quiz
Multiple Choice Easy
Question
What does `obj?.prop` evaluate to if `obj` is null?
Hint
Optional chaining short-circuits to undefined when the left side is null or undefined.
Explanation
Optional chaining ?. returns undefined immediately if the left-hand side is null or undefined, without evaluating the rest. This prevents runtime errors. Without ?., accessing a property of null would throw a TypeError.
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.