Java Reference

In-Depth Information

There is also a value
-Infinity
, which is used for negative numbers that go below

-1.7976931348623157e+308:

-1e309;

<< -Infinity

The value of Infinity can also be obtained by dividing by zero:

1/0;

<< Infinity

The smallest number that JavaScript can deal with is 5e-324. Anything below this evaluates

to either 5e-324 or zero:

5e-324;

<< 5e-324

3e-325;

<< 5e-324

2e-325;

<< 0

NaN

NaN
is an error value that is short for "Not a Number". It is used when an operation is at-

tempted and the result isn't numerical:

"hello" * 5;

<< NaN

The result returned by the
typeof
operator is rather ironic, however:

typeof Nan;

<< 'number'