The null value
Explains the use of the null value.
The null value is a special value used in some places to specify an absence of information.
For example, an array element which has not yet been set has a default value of null. The null value is not to be confused with the undefined value, which also specifies an absence of information in some contexts. See section The undefined value below.
The null value can be referenced in programs with the keyword null :
null -> the null value
When converted to a number, null yields zero (0).
Methods of null
There is only one method of null.
| Syntax | Effect |
|---|---|
| null.toString() | Returns the string "null". |