Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
BerislavLopac
on June 20, 2009
|
parent
|
context
|
favorite
| on:
PHP WTF: A PHP Annoyance Posted Every Day
The funny thing is that in Javascript:
12 == parseInt('012')
returns false. :)
mhansen
on June 20, 2009
[–]
A leading zero usually means 'this number is octal', so parseInt returns 10. Not very intuitive notation, however.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
12 == parseInt('012')
returns false. :)