constants
Summary
The following table lists predefined JavaScript constants that you can use in expressions.
Syntax
Constants
| 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 floating point number. Negative Infinity (-Infinity) is smaller than the smallest floating point number. | 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 | 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 smaller than the smallest floating point number. | Number |
| null Constant | The value of a variable that does not point to valid data. | Global |
| 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 floating point number. | 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 |
See also
Other articles
Attributions
Microsoft Developer Network: Article