Y
Hacker News
new
|
ask
|
show
|
jobs
by
spand
234 days ago
It can usually be implemented like this. No need for strings.
fun isNan(n) = n != n
2 comments
chuckadams
234 days ago
Also 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.
link
torben-friis
234 days ago
Ah, clever!
link