Null literal (Primitive value)

A literal constant whose type is a built in primitive value.

Availability:

ECMAScript edition - 2
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:Null primitive
JavaScript syntax:-null

The null literal is a value that represents the null or undefined state. It only has one value (null).

The null value is sometimes used in place of other values. For example, in some browser based interpreters, there is no specific value for the undefined condition. However, you can work around this by testing for null. Strictly speaking they are distinctly different values with different semantic meanings. Even so, the trick works well enough for most practical purposes.

Use null in place of undefined when testing for the existence of entities.

See also:Literal, Range error, Token, undefined

Cross-references:

ECMA 262 edition 2 - section - 7.7.1

ECMA 262 edition 3 - section - 7.8.1