Skip to main content
3 of 9
Made the question less of a yes/no question and more open-ended
CPlus
  • 4.5k
  • 1
  • 27
  • 50

What to do about miscellaneous (x == a || b || c) questions?

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:

This brings us to miscellaneous if (x == a || b || c ...) questions for which no language-specific canonical exists.

CPlus
  • 4.5k
  • 1
  • 27
  • 50