The null value is a primitive value that represents the null, empty, or non-existent reference.
This is equivalent to the Java null data type when passing values back and forth between JavaScript and Java.
If you don't have a null keyword, you may be able to simulate a null value like this:
var null = (void 0);
The null and undefined values are subtly different. An empty thing is not the same as a non-existent thing. However in a browser it is difficult to distinguish between them.
The null value is now provided in some browsers as a built-in keyword, but the undefined value is not.
See also: | Cast operator, JavaScript to Java values, LiveConnect, NaN, undefined |
ECMA 262 edition 2 - section - 4.3.11
ECMA 262 edition 3 - section - 4.3.11
O'Reilly JavaScript Definitive Guide - page - 47
Prev | Home | Next |
Notation.systemId | Up | null |
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. |