title: Best way to format multiple 'or' conditions in an if statement
body: <p>I have an if statement with many conditions (have to check for 10 or 15 constants to see if any of them are present.)</p>
  <p>Instead of writing something like:</p>
  <pre><code>if (x == 12 || x == 16 || x == 19 || ...)
  </code></pre>
  <p>is there any way to format it like</p>
  <pre><code>if x is [12, 16, 19]?
  </code></pre>
  <p>Just wondering if there is an easier way to code this, any help appreciated.</p>
  <p>The answers have been very helpful, but I was asked to add more detail by a few people, so I will do that to satiate their curiosity.  I was making a date validation class that needed to make sure days were not &gt; 30 in the months that have only 30 days (of which there are 4, I think) and I was writing an if statement to check things like this:</p>
  <pre><code>if (day &gt; 30 &amp;&amp; (month == 4 || month == 6 || month == 9 || month == 11))
  </code></pre>
  <p>I was just wondering if there was a faster way to code things like that - many of the answers below have helped.</p>