Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
Equality comparison and sameness
Note: The strict equality operator (as opposed to the loose equality operator) must be used here, because x == undefined also checks whether x is null, while strict equality doesn't. This is because null is not equivalen
typeof can also determine whether a variable is undefined:
typeof can also determine whether a variable is undefined:
typeof can also determine whether a variable is undefined:
typeof can also determine whether a variable is undefined:
The void operator can also be used to produce the undefined value. This is very commonly seen in minified code because void 0 is 3 bytes shorter and cannot be overridden. You should usually avoid this pattern in your own
JavaScript data types and data structures
This page was last modified on Jan 10, 2026 by MDN contributors.