Relational Operators

Top  Previous  Next

Operators:  <  <=  >  >=


expression1 < expression2

less than

expression1 <= expression2

less than or equal

expression1 > expression2

greater than

expression1 >= expression2

greater than or equal


The result of the relational operators is either true or false depending on the relative value of the expressions. If both expressions are of type String, then the relational operators compare the strings in a case-sensitive way. Otherwise, the expressions are converted to Number if necessary and their values compared. If either expression is NaN, then the result is always false.