Back to Developer Roadmap

Null Vs Undefined

src/data/question-groups/frontend/content/null-vs-undefined.md

4.0310 B
Original Source

In JavaScript, “undefined” is the default value new variables take, and it means the variable has been defined but it hasn’t been assigned any value just yet.

And “null” is actually a value that signals “no value” or “no object”, it is specifically assigned to the variable by the developer.