Number.NEGATIVE_INFINITY는 Number.MIN_VALUE보다 작은 값을 나타내는 특수 숫자 값입니다. 이 값은 "-무한대"로 표시됩니다. 수학적 동작이 무한대와 비슷합니다.
예
다음 코드를 실행하여 Number.NEGATIVE_INFINITY 상수로 작업하는 방법을 배울 수 있습니다 -
<html>
<head>
<script>
<!--
function showValue() {
var smallNumber = (-Number.MAX_VALUE) * 2
if (smallNumber == Number.NEGATIVE_INFINITY) {
alert("Value of smallNumber : " + smallNumber );
}
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="showValue();" />
</form>
</body>
</html>