Number (""); // 0 Number ("DF"); // if it cannot be converted to a number, it returns Nan
Number method:
-
Number.isNaN() 0/0 → NaN 该方法不会强制将参数转换成数字,只有在参数是真正的数字类型,且值为 NaN的时候才会返回 true
-
Determines whether the passed value is NaN.
-
Number.isFinite()
-
Determines whether the value type passed and itself is a finite number.
-
Number.isInteger()
-
Determines whether the value type passed is "number" and is an integer.
-
Number.isSafeInteger()
-
Determine whether the passed value is a safe integer (number between
-(253 - 1) and
253 - 1 ).
-
Number.toInteger()
-
computes the passed value and converts it to an integer (or infinity).
-
Number.parseFloat() parseFloat()方法将参数中指定的字符串解析成为一个浮点数字并返回
-
The same as the global object
parseFloat() .
-
Number.parseInt() parseInt() 函数将给定的字符串以指定基数(radix/base)解析成为整数
-
The same as the global object
parseInt() .
parseint (stringradix);
Javascript Number Object