ES6新增的math,Number方法

时间:2020-12-12 12:44:42
【文件属性】:
文件名称:ES6新增的math,Number方法
文件大小:27KB
文件格式:PDF
更新时间:2020-12-12 12:44:42
log mb sign ES6新增的math,Number方法,下面总结了一些我觉得有用的 Nunber.isInteger()判断是否为整数,需要注意的是1,和1.0都会被认为是整数 console.log(Number.isInteger(1.0))//true console.log(Number.isInteger(1))//true console.log(Number.isInteger("1"))//false console.log(Number.isInteger("1.1"))//false Math.sign()判断是正数,负数,还是0 console.log(Math.sign(1)

网友评论