- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I remember spotting this bug in one of our systems. It was hellish to track down. Just reading this article made me shudder.
Another 'fun' feature of the parseInt() function is that it returns the first number it comes across. It reads in every digit, until it either reaches the end of the string, or finds a non-number character, eg a letter or white space. So, give it the number "22someTtext000" it gives you 22, which is fairly sensible. But, you give it the number "22,000" and it converts that to 22.
Combining these two features together led to a marathon exercise in tedious debugging. sigh
Admin
Well, I'd rather like to kill octal too. As long as there is octal, JS developers will mistake Christmas for Helloween.
Cos' 25 dec = 31 oct.