Type Conversion & Coercion
What is the result of `3 > 2 > 1` in JavaScript?
The result of 3 > 2 > 1 is false. This is because comparison operators in JavaScript are left-associative, meaning they are evaluated from left to right. First, 3 > 2 is evaluated, which is true. Then, true > 1 is evaluated. In this comparison, true is implicitly converted to the number 1, so the comparison becomes 1 > 1, which is false. This counterintuitive result demonstrates the importance of understanding operator precedence and type coercion in JavaScript. To check if 3 is greater than 2 AND 2 is greater than 1, you would need to use the logical AND operator: (3 > 2) && (2 > 1).