5 ms·
It can usually be implemented like this. No need for strings. fun isNan(n) = n != n
by spand 11mo ago
It can usually be implemented like this. No need for strings.
fun isNan(n) = n != n
- torben-friis 11mo agoAh, clever!
- chuckadams 11mo agoAlso no need to define that in JS, because Number.isNaN() has been around forever (note the case). The global isNaN() has been there from the very beginning, but use Number.isNaN() because it doesn't coerce the param to a number.