title: Can you compare multiple variables to see if they all equal the same value in JS?
body: <p>Working in Javascript, I am trying to see if 5 different variables all contain the same value at a given time.  The value could be 1 of 6 things, but I need to see if they are all the same regardless of which value it is.  I have tried this:</p>
  
  <pre><code>if (die1 == die2 &amp; die1 == die3 &amp; die1 == die4 &amp; die1 == die5) {
      yahtzeeQualify == true;
  }
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>if (die1 == die2 == die3 == die4 == die5) {
      yahtzeeQualify == true;
  }
  </code></pre>
  
  <p>Are either of these valid?  If so, there is probably an error in my code somewhere else...if not, I'd really appreciate some help.  I also have these variables in an array called dieArray as follows:</p>
  
  <pre><code>var dieArray = [die1, die2, die3, die4, die5];
  </code></pre>
  
  <p>It would be cool to learn a way to do this via the array, but if that isn't logical then so be it.  I'll keep trying to think of a way on my own, but up until now I've been stuck...</p>