Number (Standard - JavaScript)
Represents a numeric value.
Defined in
Standard (JavaScript)Fields
Field | Description |
---|---|
MAX_VALUE (JavaScript) |
Largest positive finite value of a number. |
MIN_VALUE (JavaScript) |
Smallest positive finite value of a number. |
NaN (JavaScript) |
Value that is not a number. |
NEGATIVE_INFINITY (JavaScript) |
Negative infinity. |
POSITIVE_INFINITY (JavaScript) |
Positive infinity. |
Usage
int
, long
, and double
to
indicate intent. However, the primitive data type for all numbers
is double
.Specify literal numbers in one of the
following formats:
- Integer, for example,
2
. - Fixed, for example,
2.14
. - Exponential, for example,
214E-2
.
Server-side JavaScript gives numeric primitives and literals
access to Number methods. You can follow a string primitive or literal
with a period and the name of a Number method, as in the following
examples:
2.1.toString()
var n = 2.1;
n.toString()