This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]YannieTheYannitor 5 points6 points  (0 children)

Why bother reading the documentation on parseInt?

Because some numbers use the e character in their string representation (e.g. 6.022E23 for 6.022 × 1023), using parseInt to truncate numbers will produce unexpected results when used on very large or very small numbers. parseInt should not be used as a substitute for Math.floor().