Closed george1605 closed 2 years ago
And if you want for strings, just use:
function isEvenStr(str){ if(Number(str) != NaN) return isEven(Number(str)); }
20 years? That's too old, probably deprecated too, Samuel's approach is much more modern and by such should be preferred to your neolithic unsanitary and inefficient solution.
Write the code manually and don't be a boolean alright?
just using Boolean()
And BTW, the Modulus(%) operator exists for over 20 YEARS in JS, so it's not UNTESTED or other BLAH BLAHs.