4 ms·
> You have to consider things like: is the variable null or undefined? Does it have the Number type? Is the number an integer? This is a non-problem. If you re
by charliesome 8y ago
> You have to consider things like: is the variable null or undefined? Does it have the Number type? Is the number an integer?
This is a non-problem. If you really have to consider all these edge cases before testing if a number is odd or even that's a sign you need to seriously rethink your domain model, not reach for a library that has already thought about these edge cases for you.
Well written dynamic code should be mostly statically typed.