Different objects have different implementations.
1.Number objects:
Syntax: numberobject.tostring ([radix])
Parameters: Radix, optional/number type, specified cardinality (number of digits), support for integers between [2,36], default (default) is 10 (10 binary).
Special: Parameters not only support the regular 2,8,16, but also support unconventional 1,2...36 and so on, really 6.
Return value: A string of type value that returns the number specified in the binary form.
Simple example:
varnum = 1024;// BinaryConsole.log (num.tostring (2));//"10000000000"Num= 562345.12456;//Default DecimalConsole.log (Num.tostring ());//"562345.12456"Console.log (num.tostring (10));//"562345.12456"Num= 1245;//octalConsole.log (num.tostring (8));//"2335"Num= 4564561;//hexadecimalConsole.log (Num.tostring (16));//"45a651"
Complex examples:
// Generate random string Math.random (). toString (+). substring (2);
JavaScript built-in functions: toString ()