JS Comparisons
Comparison operators are used in logical statements to determine equality or difference.
Comparison operators are used in logical statements to determine equality or difference between variables or values.
Comparison Operators
| Operator | Description |
|---|---|
== | equal to |
=== | equal value and equal type |
!= | not equal |
!== | not equal value or not equal type |
> | greater than |
< | less than |
>= | greater than or equal to |
<= | less than or equal to |
How Can it be Used
Comparison operators can be used in conditional statements to compare values and take action depending on the result.
Preview
Logical Operators
Logical operators are used to determine the logic between variables or values.
&&(Logical AND) - Returns true if both expressions are true.||(Logical OR) - Returns true if one or both expressions are true.!(Logical NOT) - Reverses the boolean result.
Preview