Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Hovertruck
on Jan 13, 2013
|
parent
|
context
|
favorite
| on:
Be careful with JS numbers
Think of parseInt() as what it says- parsing out the number value. Number() can be considered as a cast.
parseInt('12', 10); => 12 Number('12'); => 12 parseInt('12x', 10); => 12 Number('12x'); => NaN
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: