isNaN() 함수는 값을 받아들이고 주어진 값이 숫자인지 여부를 결정합니다. 그렇다면 이 메서드는 true를 반환하고 그렇지 않으면 false를 반환합니다. Number 개체를 사용하여 이 메서드를 호출할 수도 있습니다.
구문
구문은 다음과 같습니다.
isNAN(5655);
예시
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result1 = parseFloat("Ef00A.D3");
document.write(isNaN(result1));
document.write('<br>');
var result2 = Math.log("welcome");
document.write(isNaN(result2));
document.write('<br>');
var result3 = Math.log(1254);
document.write(isNaN(result3));
</script>
</body>
</html> 출력
true true false