JavaScript Constants
The following table lists predefined JavaScript constants that you can use in expressions.
Constant | Description | JavaScript object |
---|---|---|
The mathematical constant e. This is Euler's number, the base of natural logarithms. | Math | |
A value that is larger than the largest number that can be represented in JavaScript. | Global | |
The natural logarithm of 2. | Math | |
The natural logarithm of 10. | Math | |
The base-2 logarithm of e. | Math | |
The base-10 logarithm of e. | Math | |
The largest number that can be represented in JavaScript. | Number | |
The closest number to zero that can be represented in JavaScript. | Number | |
A special value that indicates that an arithmetic expression returned a value that is not a number. | Number | |
A value that indicates that an expression is not a number. | Global | |
A value that is more negative than the largest negative number that can be represented in JavaScript. | Number | |
Pi. This is the ratio of the circumference of a circle to its diameter. | Math | |
A value that is larger than the largest number that can be represented in JavaScript. | Number | |
The square root of 0.5, or, equivalently, one divided by the square root of 2. | Math | |
The square root of 2. | Math | |
The value of a variable that has been declared but not initialized. | Global |