Export (0) Print
Expand All

JavaScript Constants

The following table lists predefined JavaScript constants that you can use in expressions.

Constant

Description

JavaScript object

E

The mathematical constant e. This is Euler's number, the base of natural logarithms.

Math

Infinity

A value that is larger than the largest number that can be represented in JavaScript.

Global

LN2

The natural logarithm of 2.

Math

LN10

The natural logarithm of 10.

Math

LOG2E

The base-2 logarithm of e.

Math

LOG10E

The base-10 logarithm of e.

Math

MAX_VALUE

The largest number that can be represented in JavaScript.

Number

MIN_VALUE

The closest number to zero that can be represented in JavaScript.

Number

NaN

A special value that indicates that an arithmetic expression returned a value that is not a number.

Number

NaN (Global)

A value that indicates that an expression is not a number.

Global

NEGATIVE_INFINITY

A value that is more negative than the largest negative number that can be represented in JavaScript.

Number

PI

Pi. This is the ratio of the circumference of a circle to its diameter.

Math

POSITIVE_INFINITY

A value that is larger than the largest number that can be represented in JavaScript.

Number

SQRT1_2

The square root of 0.5, or, equivalently, one divided by the square root of 2.

Math

SQRT2

The square root of 2.

Math

undefined

The value of a variable that has been declared but not initialized.

Global

Community Additions

Show:
© 2014 Microsoft