An expression that always produces the same result, regardless of the inputs, is unnecessary and likely indicates a programmer’s error. This can
come from
- confusing operator precedence
- expecting strict equality between different types
- expecting objects to be compared by value
- expecting empty objects to be
false
or null
- mistyping
>=
for ⇒
This can also happen when you put an assignment in a logical sub-expression. While not strictly a bug, this practice is confusing and should be
avoided.