4 ms·
I'm not sure that's right. 1/0 is undefined NOT infinity, hence -1/0 is also undefined. So actually line 3 should evaluate as true.
by Arkanum 10y ago
I'm not sure that's right. 1/0 is undefined NOT infinity, hence -1/0 is also undefined. So actually line 3 should evaluate as true.
- kuschku 10y agoNaN === NaN evaluates to false. That’s what happens here, not anything with Infinity.
- Arkanum 10y agoYeah, that makes sense mostly. But why is NaN === NaN false? What am I missing here?
- kuschku 10y agoBecause there is many ways NaN can be generated, all very different. == is only defined for numbers, too. 1/0 and 50/0 aren’t the same, for example.
- caub 10y agojust type them in your console instead of saying wrong things