Comparison Operators in JavaScript
Comparison Operators
We can use comparison operators in logical statements to find out if variables or values are different. You get either true or false.
The list of comparison operators is:-
Operator | Description | Example |
== | equal to | 3==6 false |
=== | equal and identical | 3==6 false |
!= | not equal to | 3!=6 true |
!== | not identical | 3!==6 true |
> | greater than | 3 > 6 false |
< | less than | 3 < 6 true |
>= | greater than or equal to | 3 >=6 false |
<= | less than or equal to | 3 <= 6 true |