~ :按位取反 应用: 取整:~~1.2 //1 比 parseInt、Math.floor 性能快 用 ~someArray.indexOf(someValue) 代替 someArray.indexOf(someValue) !== -1,因为 ~-1=0,所以可以利用这一点去做判断。