isFinite() 是否有限

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		console.log(isFinite(NaN));
		console.log(isFinite(Infinity));
		console.log(isFinite(-Infinity));
		console.log(isFinite(0));
		console.log(isFinite(10));
		console.log(isFinite('10'));
	</script>
</body>
</html>

  结果如下:

 

 所以,isFinite() 的作用就是,当参数不是NaN、Infinity、-Infinity 时,返回true。 

posted @ 2017-07-09 16:13  likwin  阅读(159)  评论(0编辑  收藏  举报