⏱ 0:01est. 2 min
Chapter 25- Comparison Operators
Notes
Example 1
console.log(1<2<3); //true
Less than operator has left to right associativity so 1 < 2 return true then true will be coerced to 1 and 1 < 3 will return true.
------------------------------------------------------------------------------------------
Example
console.log(3<2<1); //true
Less than operator has left to right associativity so 3 < 2 returns false then false will be coerced to 0 and 0 < 1 will return true
Check
Number(undefined); // NaN
Number(null); //0