MIN_VALUE (JavaScript)
Smallest positive finite value of a number.
Defined in
Number (Standard - JavaScript)Syntax
Number.MIN_VALUE
Usage
MIN_VALUE is a constant and has the same value whether called statically as shown in the syntax or from an object.MIN_VALUE is approximately 4.9E-324.
A number less than MIN_VALUE has the value 0.
Examples
This example prints MIN_VALUE then demonstrates that an extremely small number is less than MIN_VALUE.function p(stuff) {
print("<<<" + stuff + ">>>");
}
try {
p(Number.MIN_VALUE.toPrecision(1)); // prints <<<4.9E-324>>>
var n = new Number(4.9E-325);
if (n < Number.MIN_VALUE) {
p(n + " < Number.MIN_VALUE");
// prints <<<0 < Number.MIN_VALUE>>>
}
} catch(e) {
p("Error = " + e);
}