title: Simplifying Long Javascript IFs
body: <p>I found this on the internet on how to make an if stament smaller:</p>
  
  <pre><code>if([1,5,7,22].indexOf(myvar)!=-1) alert('yeah')
  </code></pre>
  
  <p>From this:</p>
  
  <pre><code>if( myvar==1 || myvar==5 || myvar==7 || myvar==22 ) alert('yeah')
  </code></pre>
  
  <p>Is there a way to do this where instead of having 4 myvar, there are 3 different values? What I want is for the original statement to be:</p>
  
  <pre><code>if(i('b').style.display == a[1] &amp; i('c').style.display == a[1] &amp; i('d').style.display == a[1])
  </code></pre>
  
  <p>I want to try shorten this as much as possible... any points? I have searched the internet a lot about this and found nothing...</p>