A mental map: which operator to use and when
Choosing the right operator leads to predictable decisions in your code.
Not all operators solve the same problem. Some calculate, some compare, some combine conditions and others update values with clear intent.
If you internalize that classification, it becomes much easier to build clean logic instead of chaining patches together.
Arithmetic
They transform numbers.
- +, -, *, /, %
- Prices, tax, discounts, averages
Comparison
They answer with `true` or `false`.
- ===, !==, >, =, =
- Useful in validation and access rules
Logical
They combine conditions.
- &&, ||, !
- Permission systems and compound filters
Assignment
They update state quickly.
- =, +=, -=, *=, /=
- Counters and accumulators