isFinite()
전역 함수는 주어진 값이 유한수인지 판별합니다. 필요한 경우 매개변수를 먼저 숫자로 변환합니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
구문
isFinite(testValue)
매개변수
testValue
- 유한한지 판별할 값.
반환 값
설명
isFinite()
은 최상위 함수로 어떤 객체와도 연결되지 않았습니다.
숫자가 유한수인지 판별하기 위해 isFinite()
을 사용할 수 있습니다. isFinite()
은 주어진 수를 검사해 그 값이 NaN
, 양의 무한대, 또는 음의 무한대이면 false
를 반환합니다. 그렇지 않으면 true
를 반환합니다.
예제
isFinite()
사용하기
isFinite(Infinity); // false
isFinite(NaN); // false
isFinite(-Infinity); // false
isFinite(0); // true
isFinite(2e64); // true
isFinite(910); // true
isFinite(null); // true, would've been false with the
// more robust Number.isFinite(null)
isFinite('0'); // true, would've been false with the
// more robust Number.isFinite("0")
명세
브라우저 호환성
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.