This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

constants

Summary

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

Syntax

Constants

ConstantDescriptionJavaScript object
EThe mathematical constant e. This is Euler’s number, the base of natural logarithms.Math
InfinityA value that is larger than the largest floating point number. Negative Infinity (-Infinity) is smaller than the smallest floating point number.Global
LN2The natural logarithm of 2.Math
LN10The natural logarithm of 10.Math
LOG2EThe base-2 logarithm of e.Math
LOG10EThe base-10 logarithm of e.Math
MAX_VALUEThe largest number that can be represented in JavaScript.Number
MIN_VALUEThe closest number to zero that can be represented in JavaScript.Number
NaNIndicates 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_INFINITYA value that is smaller than the smallest floating point number.Number
null ConstantThe value of a variable that does not point to valid data.Global
PIPi. This is the ratio of the circumference of a circle to its diameter.Math
POSITIVE_INFINITYA value that is larger than the largest floating point number.Number
SQRT1_2The square root of 0.5, or, equivalently, one divided by the square root of 2.Math
SQRT2The square root of 2.Math
undefinedThe value of a variable that has been declared but not initialized.Global

See also

Other articles

Attributions

  • Microsoft Developer Network: Article