Why does JavaScript’s parseInt(0.0000005) print “5”?
The parseInt(string, radix) function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems) The first step is to convert the number to string and the second step is the rounding operation. The answer will return 5 only because it is the only character that is a number till a noncharacter e, so the rest of it e-7 is discarded.