This page was translated from English by the community.Learn more and join the MDN Web Docs community.
Number.MAX_VALUE
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
Number.MAX_VALUE 속성은 JavaScript가 표현할 수 있는 제일 큰 양의 숫자 값을 나타냅니다.
In this article
시도해 보기
function multiply(x, y) { if (x * y > Number.MAX_VALUE) { return "Process as Infinity"; } return x * y;}console.log(multiply(1.7976931348623157e308, 1));// Expected output: 1.7976931348623157e+308console.log(multiply(1.7976931348623157e308, 2));// Expected output: "Process as Infinity"Property attributes ofNumber.MAX_VALUE | |
|---|---|
| 쓰기 가능 | 불가능 |
| 열거 가능 | 불가능 |
| 설정 가능 | 불가능 |
설명
MAX_VALUE의 값은 약1.79E+308, 2^1024입니다.MAX_VALUE보다 큰 값은Infinity로 표현됩니다.
MAX_VALUE는Number의 정적 속성이기 때문에, 직접 생성한Number 객체의 속성이 아니라Number.MAX_VALUE 형식으로 사용해야 합니다.
예제
>MAX_VALUE 사용하기
다음 코드는 두 개의 수를 곱합니다. 만약 결과가MAX_VALUE 이하면func1을 호출하고, 그렇지 않으면func2를 호출합니다.
js
if (num1 * num2 <= Number.MAX_VALUE) { func1();} else { func2();}명세
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-number.max_value> |