有一个有效用例用于双重非运算操作符。可以用来代替Math.floor(),其优势在于运行更快,可以阅读此文章了解更多位运算。

Math.floor(4.9) === 4  //true

简写

~~4.9 === 4  //true
posted on 2017-06-22 16:54  正正果实  阅读(283)  评论(0编辑  收藏  举报