Joined October 2012
·
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
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Forked
Have a project valued enough to be forked by someone else
Charity
Fork and commit to someone's open source project in need
Python 3
Have at least three original repos where Python is the dominant language
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
Cub
Have at least one original jQuery or Prototype open source repo
That's great! haha