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 |
Prev | Home | Next |
null | Up | Null statement |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |