JavaScript undefined Property
undefined is the value of a variable that has been declared but not assigned, a missing property or argument, and a function that returns nothing.
Description
undefined is a primitive value that means no value has been assigned. It's what you get from a declared variable with no value, a property that doesn't exist, a missing function argument, and a function with no return. It's different from null, which is usually set deliberately to mean "empty".
Check for it with x === undefined, or use x == null to catch both undefined and null. The ?? operator supplies a default for either.
In function parameters, default values apply only when the argument is undefined, not null. JSON.stringify() leaves out properties whose value is undefined, while it keeps null, which is one reason APIs often prefer null for "no value".
Syntax
undefinedValue
The primitive value undefined.
Example
Browser Support
The following information will show you the current browser support for the undefined property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





