The undefined value

Explains the use of the undefined value.

The undefined value is a special value used in some places to specify an absence of information. For example, accessing a property of a value which is not defined, or a local variable which has been declared but not initialized, yields the undefined value.

There is no way of referencing the undefined value in programs. Checking if a value is the undefined value can be done using the typeof operator:


typeof(value) == "undefined" -> true if value is undefined, 
                                 false otherwise.  

Methods of undefined

There is only one method of undefined.

Table 1. Methods of undefined
Syntax Effect
undefined.toString() Returns the string "undefined".