This content originally appeared on Bram.us and was authored by Bramus!
Dmitri Pavlutin digs into why parseInt(0.0000005);
evaluates to 5
:
parseInt(0.5); // => 0
parseInt(0.05); // => 0
parseInt(0.005); // => 0
parseInt(0.0005); // => 0
parseInt(0.00005); // => 0
parseInt(0.000005); // => 0
parseInt(0.0000005); // => 5 ?
Solving a Mystery Behavior of parseInt()
in JavaScript →
This content originally appeared on Bram.us and was authored by Bramus!

Bramus! | Sciencx (2021-05-11T15:32:41+00:00) Solving a Mystery Behavior of parseInt() in JavaScript. Retrieved from https://www.scien.cx/2021/05/11/solving-a-mystery-behavior-of-parseint-in-javascript-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.