JavaScript Number Object
---------Number object is the wrapper object for the original numeric value.
Create a Number Object
var num = new number (10);
var num = number (10); ---parentheses are the values of the number object that you want to create or the value that is converted to numbers.
return value:
1. Returns a newly created number object when number () and operator new are used together as constructors
2, directly using number () as a function to call, it will convert its own parameters to the numeric value of an element, and return it (if the conversion fails, then return nan)
/* Below a simple example * *
Number (NULL)//0
Number (true)//1
Number (false)//0
Number (' 1 ')//1
Number (' a ')//nan
Number (undefined)//nan
Number Object Description
In JavaScript, a number is a basic type of data. JavaScript also supports the number object, which is the wrapper object for the original numeric value. When necessary, JavaScript automatically converts between raw data and objects.
Number Object method
ToString---Converts a number to a string, using the specified cardinality
/* Converts a Number object to a string and returns the result * *
Numberobject.tostring (Radix)
-----Radix Optional Parameters. A rule that represents the cardinality of a number, making an integer between 2~36. The default is 10.