Joined October 2012
·

Davide Callegari

brokenseal
·
Pont St Martin, Valle d'Aosta
·
·
·

That's great! haha

Posted to parseInt() can be dangerous over 1 year ago

Correct, the fact that it doesn't always return what you want (like in the case you @rstacruz, just described) makes me dislike that approach @passcod.

Even more, I come from a Python background and I always try to avoid anything that it is not clear to read. And that is not clear at all.
I mean, you can turn anything into a boolean adding !! in front of it, but do you really want to use that approach?

I'm all for type casting, not so for type coercion.

Posted to parseInt() can be dangerous over 1 year ago

@passcod Avoid type coercion at all costs, it can backfire at you pretty hard

Achievements
59 Karma
0 Total ProTip Views