Student-friendly HTML, CSS, and JavaScript reference with examples
Comparison operators compare two values and return true or false.
a > b // greater than
a >= b // greater than or equal to
a < b // less than
a <= b // less than or equal to
a === b // exactly equal (same type and value)
a !== b // not equal (different type or value)
15 > 10 // true
8 >= 8 // true (equal counts!)
5 < 12 // true
20 === 20 // true
5 !== 10 // true (they are different)
const temp = 75;
const isWarm = temp > 20; // true
const isCool = temp <= 15; // false
const isExact = temp === 75; // true