JavaScript Resources

Comparison Operators

The examples in the previous section, used the symbols == to make the comparison in the conditions. These two symbols together mean compare the equality of these two values.

In addition, conditions in JavaScript can use the following symbols, also collectively known as operators, for comparing values:

    ==     equal to

    !=     not equal to

    >      greater than

    <      less than

    >=     greater than or equal to

    <=     less than or equal to

Generally, == and != can be used for comparing numbers and text. The others only make sense for comparing numeric values.

Next up ... Logical Operators