I have seen: Canonical, language-agnostic question for if(var != "x" || var != "y" ...)
That question asks a canonical for questions about the if (x != a || x != b ...)
and resulted in one being created: Why does non-equality check of one variable against many values always return true?
The question also mentions a similar if (x == a || b || c ...)
problem, for which several canonical questions exist, but only for specific languages:
- Python: Why does "a == x or y or z" always evaluate to True? How can I compare "a" to all of those?
- Java: How to format multiple 'or' conditions in an if statement
- C++: Most efficient way to compare a variable to multiple values?
This brings us to miscellaneous if (x == a || b || c ...)
questions for which no language-specific canonical exists.
- Should a new language-agnostic canonical be created for those?
- Should they be closed as a duplicate of Why does non-equality check of one variable against many values always return true? Even though the underlying cause of the problem is different? And should that one be modified to include
if (x == a || b || c ...)
questions? - Should they be closed as a duplicate of a canonical of a different language?