You should actually be using Number.isNan() over the global isNaN function which will give somewhat unexpected results in comparison to the newer method on the Number object. You should also use !Number.isFinite() instead of checking equality with Infinity.
Thanks. That's a good catch.
You should actually be using Number.isNan() over the global isNaN function which will give somewhat unexpected results in comparison to the newer method on the Number object. You should also use !Number.isFinite() instead of checking equality with Infinity.
Thanks. That's also a good tip.
I think equality is still good as long as we use triple equals.
Yes, you can still write it that way.