JavaScript Number Type
Comparison
We can compare two numbers and determine equality and inequality. We can also use the less-than and greater-than operators to find the largest or smalles number. All of these operators return a Boolean value.
We determine equality with the value equality operator == or the
value and type equality operator ===. Inequality have their own
counter parts: != and !==. We recommend always using === as the
behavior is more predictable than loose
equality.
Code example: equality/inequality
const a = 123const b = 123const c = 345console.log(a === b) // trueconsole.log(a === c) // falseconsole.log(a !== c) // true
Code example: less-than/greater-than
const a = 123const b = 345console.log(a < b) // trueconsole.log(a > b) // false