JavaScript Number.NEGATIVE_INFINITY

Number.NEGATIVE_INFINITY 跟 -Infinity 是一樣的,表示無限小的負數。

Number.NEGATIVE_INFINITY === -Infinity // true

用法例如:

var smallNumber = (-Number.MAX_VALUE) * 2;

if (smallNumber === Number.NEGATIVE_INFINITY) {
    // -Infinity
}