In a previous lesson we covered the order of operations. This is a rule of math that says which operators act first.
We also have the comparison operators:
- greater than
- less than
- equal to
- greater than or equal to
- less than or equal to
These operators go after the math operators.
Try this code:
7 - 3 < 2 + 4
7 - 3 < 2 + 4 // original expression 4 < 6 // after math operators are evaluated true // after comparison operator is evaluated
Remember that math operators always go first, then the results are compared.
When the comparison operator runs, the result is
false as always.