Home >Web Front-end >JS Tutorial >Introduction to the use of isNaN() method of global objects in javascript_javascript skills

Introduction to the use of isNaN() method of global objects in javascript_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:08:141304browse

Copy code The code is as follows:



isNaN() method of global object
<script> <br>/* <br>isNaN() function is usually used to detect the results of parseFloat() and parseInt() , to determine whether they represent legal numbers. <br>Of course, you can also use the isNaN() function to detect arithmetic errors, such as using 0 as a divisor. <br>*/ <br>document.write(isNaN(123) "<br/>");//false <br>document.write(isNaN(-1.23) "<br/>") ;//false <br>document.write(isNaN(5-2) "<br/>");//false <br>document.write(isNaN(0) "<br/>") ;//false <br>document.write(isNaN("Hello") "<br/>");//true <br>document.write(isNaN("2005/12/12") "< br/>");//true <br></script>




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn