js中小数取整的方法
var num =123.123
常用方法
console.log(parseInt(num));//123
“双按位非”操作
console.log(~~num);//123
按位或
console.log(num | 0);//123
按位异或
console.log(num ^ 0);//123
左移操作符
console.log(num << 0);//123
var num =123.123
console.log(parseInt(num));//123
console.log(~~num);//123
console.log(num | 0);//123
console.log(num ^ 0);//123
console.log(num << 0);//123