🔰comparison operator
<, >, <=, >= operators
Last updated
<, >, <=, >= operators
Last updated
JS ⟩ statement ⟩ expression ⟩ operator ⟩ relational ⟩ comparison
if either operand is (or converts to) NaN, the result is false.
<=
and >=
do not rely on ==
or ===
with one exception, if either operand is NaN, the result is always false
type conversion is involved in comparison.
object -> primitive conversion is involved in comparison.
comparison favors numbers, add/concate (+) favors strings.