1. typeof undefined
undefined has its own type tag — typeof undefined is the string "undefined".
typeof undefined === "undefined" // trueTyporithm · easy
Step 1 of 8 · intro card
JS Gotchas
undefined means a value was never set; null is an intentional empty. typeof undefined is "undefined", but typeof null is "object" — a famous bug. ?? supplies a default for both null and undefined, and ?. safely reads nested properties.
undefined is the default for variables and missing properties; null is an explicit "no value" you assign on purpose. typeof undefined is "undefined".
typeof null returns "object" — a well-known language bug preserved for backward compatibility, so never use typeof to detect null.
Nullish coalescing (x ?? "default") supplies a fallback only when x is null or undefined, and optional chaining (obj?.prop) reads nested values without throwing when an intermediate is nullish.
undefined = never set; null = intentional empty.
typeof null is "object" (a famous bug).
?? covers null AND undefined; ?. avoids throwing.
typeof undefined === "undefined" // true
typeof null === "object" // true — a famous bug
const name = user.name ?? "default" // covers null AND undefined
const city = user.address?.city // optional chaining, no throwConnect each part of the code to the concept before you type.
undefined has its own type tag — typeof undefined is the string "undefined".
typeof undefined === "undefined" // truetypeof null returns "object" — a long-standing language bug kept for backward compatibility.
typeof null === "object" // true — a famous bug?? returns the right side only when the left is null or undefined, covering both at once.
user.name ?? "default"?. short-circuits to undefined if address is null or undefined instead of throwing.
user.address?.cityRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.