A. A lack of skills to convert a string to a number but it is clear that the numbers () constructor is called as a function:
var number = number (string_value);
B. parseint () intercepts only integers, if a string begins with "0x" or "0X", parseint () resolves it to a hexadecimal number, parseint () can even accept a parameter to specify the cardinality of the number to parse, with a valid value between 2 and 36
parseint ("3 Blind Mice"); Returns 3
parseint ("12.34"); Returns 12
parseint ("0xFF"); Returns 255
parseint ("11", 2); Returns 3 (1 * 2 + 1)
parseint ("FF", 16); Returns 255 (15 * 16 + 15)
parseint ("ZZ", 36); Returns 1295 (35 * 36 + 35)
parseint ("077", 8); Returns 63 (7 * 8 + 7)
parseint ("077", 10); Returns 77 (7 * 10 + 7)
C. parsefloat () intercepts integers and floating-point numbers.
Parsefloat ("3.14 meters"); Returns 3.14
D. If parseint () and parsefloat () are not able to convert the specified string to a number, they return Nan:
parseint (' eleven '); Returns Nan
Parsefloat ("$72.47"); Returns NaN
How JavaScript is rounded
A. Discard the fractional part, preserving the integral portion of the
parseint (5/2)
B. Rounding up, with decimals on the integer part plus 1
Math.ceil (5/2)
C. Rounding down
Math.floor (5/2)
D. Rounding
Math.Round (5/2)
JS string conversion to digital summary