5 ms·
"hello" - 1 doesn't return NaN out of some sense of exception to trying to subtract from a string. It returns it because parseFloat("hello") = NaN, and NaN - 1
by maximusprime 15y ago
"hello" - 1 doesn't return NaN out of some sense of exception to trying to subtract from a string.
It returns it because parseFloat("hello") = NaN, and NaN - 1 = NaN.