Section 3.7. null


3.7. null

The JavaScript keyword null is a special value that indicates no value. null is usually considered a special value of object typea value that represents no object. null is a unique value, distinct from all other values. When a variable holds the value null, you know that it does not contain a valid object, array, number, string, or boolean value.[*]

[*] C and C++ programmers should note that null in JavaScript is not the same as 0, as it is in those languages. null is automatically converted to 0, but the two are not equivalent.

When null is used in a Boolean context, it converts to false. When used in a numeric context, it converts to 0. And when used in a string context, it converts to "null".




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net