3 ms·
The Javascript tradition is coercing '1' to 1, so it is a number for most practical purposes. A language with more restrained type conversion rules would have
by HelloNurse 9y ago
The Javascript tradition is coercing '1' to 1, so it is a number for most practical purposes.
A language with more restrained type conversion rules would have a different, and more trivial, isOdd() function.