2 ms·
>> there are number and string values x, y, and z, such that x<y, y<z, and z<x Again though < and > are numerical operators as poster pointed out so comparing
by wavefunction 9y ago
>> there are number and string values x, y, and z, such that x<y, y<z, and z<x
Again though < and > are numerical operators as poster pointed out so comparing a number to a string using these operators is... 'nonsensical' if that's perhaps the right term.
Consider checking if object foo > 1. What would that mean?
- yorwba 9y agoThat's the point. JavaScript lets you do nonsensical operations that are easily detectable as nonsensical, but instead of throwing an exception, it goes out of its way to prevent you from noticing that anything is off.