二进制以0b开头,b可小写也可以大写
console.log(0b1111);//15
八进制以0o开头,o字母可小写也可大写
console.log(0o10);//16
Number.isFinite() 判断一个数是不是有尽的,若是有尽的返回true,否则返回false
console.log(Number.isFinite(15));//true
console.log(Number.isFinite(NaN));//false
console.log(Number.isFinite(10/0));//false
console.log(Number.isNaN(NaN));//true
console.log(Number.isNaN(5));//true
Number.isInteger() 判断一个数是不是整数
console.log(Number.isInteger(25));//true
console.log(Number.isInteger(25.0));//true
console.log(Number.isInteger(25.1));//false
console.log(Number.MAX_SAFE_INTEGER);//9007199254740991
console.log(Number.MIN_SAFE_INTEGER);//-9007199254740991
console.log(Number.isSafeInteger(100));//true
console.log(Number.isSafeInteger(9007199254740992));//false
console.log(Math.trunc(4.1));//4
console.log(Math.trunc(-4.1));//-4
console.log(Math.sign(-2));
console.log(Math.sign(0));
console.log(Math.sign(2));
console.log(Math.sign('-2'));
console.log(Math.sign('haha'));//NaN
Math.cbrt() 返回一个数的立方根
console.log(Math.cbrt(-1));//-1
console.log(Math.cbrt(8));//2