(!isNaN('100') && isFinite('100'))
Negation (!) before isNaN()
(!isNaN('100') && isFinite('100')) === true
My check would treat '100' as a number, so if i did something like this it would break unexpectedly:
var num = '100' if ((!isNaN(num) && isFinite(num)) === true) { console.log(num + 10) }
There's no way on earth we'd be arguing about such a ridiculously trivial thing for most other languages.
Nobody should have to look any of this up.
Yeah, we work around it ... but it drives me crazy. :)
(!isNaN('100') && isFinite('100')) === true
My check would treat '100' as a number, so if i did something like this it would break unexpectedly:
You'll get "10010" printed to the console.