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。
author:Lik
Endeavoring to powerless, struggling to move yourself.
Endeavoring to powerless, struggling to move yourself.