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

2m read timeFrom javascript.plainenglish.io
Post cover image
Table of contents
2. Some things about parseInt3. How does parseInt convert numbers?3.1. The first step is to convert the number to string3.2. The second step is to do the rounding operation.4. How to get the integer part of a floating-point number safely?5. learn by analogy
5 Comments

Sort: