JS-Number类型
基本函数类型:
<script> //判断是否整数 let num = 99; console.log(Number.isInteger(num)); let num_1 = 99.9; console.log(Number.isInteger(num_1)); //小数点后第几位四舍五入 let num_2 = 99.655; console.log(num_2.toFixed(2)); </script>
NaN:我们期望是一个数字,但是不是数字
<script> console.log(Number("hhh")); </script>