Favorites

JavaScript undefined Property

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
undefined
JavaScript Global propertyThis property is supported by all modern browsers.
Updated 28th November 2026

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

undefined

Value

The primitive value undefined.

Example

let a;
console.log(a);
console.log({}.missing);
console.log((function () {})());
console.log(typeof undefined);
console.log(undefined ?? 'default');

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.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee