Sunday, June 11, 2017

Let's parse the function "parseInt", which appears in both Java and JavaScript.

>
> parseInt(12.5);
12
>

In the above little example, 12.5 is not an Int, but is a float. On the other hand, the return value 12 is an Int.

So, a more accurate name for the function would be "parseToInt."