#17: 1 < 2 < 3
Topic: misc · Difficulty: ★
console.log(1 < 2 < 3);Output
true
Why
JavaScript has no real concept of chained comparisons like math notation does — there's no special-casing for a < b < c meaning 'both a<b and b<c'. Instead, < is left-associative, so this parses as (1 < 2) < 3. The parenthesized part evaluates first to the boolean true, and then true < 3 coerces true to the number 1, giving 1 < 3, which is true. It works out here, but it's a coincidence of the specific numbers, not a real range check.
More misc puzzles