CKTIS / JavaScript
Undefined — a type with the single value undefined
Undefined is a primitive JavaScript type with exactly one value: undefined. Learn the difference between the type name, its value, and the string "undefined", and distinguish this value from null.
Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
Syntax
let value;
value === undefined;
typeof value === "undefined";Undefined is the type name in the ECMAScript specification, while undefined is its only primitive value. Undefined is not a built-in constructor, and JavaScript has no built-in syntax for specifying a variable's type in its declaration. Undefined is a valid variable name, though: let Undefined; declares a variable, not a type.
After let value; executes, the variable value has the value undefined. This does not mean that any variable can be read before its declaration: reading a variable declared with let or const before its initialization throws ReferenceError.
The expression typeof value returns the string "undefined", not the value undefined itself. Use value === undefined to check the value directly. The value null belongs to the separate type Null, so undefined === null evaluates to false.
The global undefined property is non-writable and non-configurable, but a local declaration can shadow its name. Avoid naming parameters or local variables undefined so that comparisons remain clear and correct.
Examples
let value;
const explicit = undefined;
console.log(typeof value);
console.log(value === explicit);
console.log(value === null);Result
undefined true false
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.