News for hackers. Stuff that matters.
Re:The Birth and Death of JavaScript [video] by nathansobo on Thursday April 17, 2014 @06:41PM (#7606974)
I just wrote this line about two hours ago and my tests weren't thorough enough to catch the bug it introduced. Just when I thought I knew JavaScript. Thanks for saving me some time.
Re:The Birth and Death of JavaScript [video] by bsder on Thursday April 17, 2014 @07:09PM (#7607096)
Always give the base to parseInt in Javascript.

Always. The moment you don't, all kinds of bugs follow.

I have to go cry now at the number of times this has bitten me.

Re:The Birth and Death of JavaScript [video] by ajanuary on Friday April 18, 2014 @04:43AM (#7608480)
Not just javascript, a whole bunch of language's parseInt implementation will interpret the base from a leading zero etc.
Re:The Birth and Death of JavaScript [video] by TazeTSchnitzel on Thursday April 17, 2014 @08:41PM (#7607391)
Are there any other problems aside from octal?
Re:The Birth and Death of JavaScript [video] by iamthepieman on Thursday April 17, 2014 @06:46PM (#7606998)
I'm sure you know this by now but you can keep the syntax and use Number instead

xs.parseInt(Number)

Re:The Birth and Death of JavaScript [video] by matb33 on Thursday April 17, 2014 @07:26PM (#7607164)
I think xs.map(Math.floor) takes the cake if I recall speed tests properly
Re:The Birth and Death of JavaScript [video] by _random_ on Saturday April 19, 2014 @02:26PM (#7614212)
Always remember - it's not a language but a loosely parsable texty thing.