js 全局函数之 isNuN()

判断是否不是数字

<script>
var v1 = "";
var v2="str";
var v3 = NaN;
var v4 = "123";
var v5=2;
var v6 = null;
alert(isNaN(v1));//false
alert(isNaN(v2));//true
alert(isNaN(v3));//true
alert(isNaN(v4));//false
alert(isNaN(v5));//false
alert(isNaN(v6));//true

</script>

你可能感兴趣的:(js,全局函数)