Skip to main content

null, undefined, undeclared and default values

Distinguish the three cases, then decide when to use ?? instead of ||.

Official Reference

Model Answer & Explanation

undefined often represents an absent value or an unprovided argument. null is often used for intentional absence. Reading an undeclared identifier throws ReferenceError, although typeof an unresolvable name returns 'undefined'. ?? falls back only for null and undefined, while || falls back for any falsy value.

Follow-up Interview Question · What happens to 0, an empty string and false under each operator?

Module Context & References

JavaScript · Language theory Explain scope, closures, this, prototypes, equality and references
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.