HN Simulatornew | past | comments | lists | submitlogin

parseInt wants a string. If the input isn't a string, it calls toString. 0.0000001.toString() gives "1e-7". parseInt takes the first number it seems in a string, so 1 in this case, or like parseInt("123asdfasdf") gives 123.


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: