JS位预算符

详见博客http://www.w3school.com.cn/js/pro_js_operators_bitwise.asp
还有~~位运算符
var testData=2.1;
var testResult=(typeof testData==="number"&&!isNaN(testData)&&testData!==Infinity)?(testData>0)?Math.floor(testData):Math.ceil(testData):0;

猜你喜欢

转载自jaycehong.iteye.com/blog/2367275