Comparison Operators
Comparison Operators
Comparison Operators are used mainly in conditional statements in order to compare the two operands.
Comparison Operators mainly returns value in true or false.
The list of Comparison Operators are as follows:
Operator |
Description |
Example |
---|---|---|
== |
Equal to |
2 = = 5 False |
=== |
Identical Equal |
2 = = = 5 False |
!= |
Not Equal |
2! = 5 True |
!== |
Identical Not Equal |
2! = = 5 False |
> |
Greater than |
2 > 5 False |
>= |
Lesser than or equal to |
2 > = 5 False |
< |
Less than |
2 < 5 True |
<= |
Less than or equal to |
2 < = 5 True |