title: How do I check a condition for every element in an array?
body: <p>I have a piece of code that I want to run only if certain conditions are true for every element in an array. Currently, I have to know the length of the array for any of the code to work, but my end goal is to have it work for an array of any length.</p>
  
  <p>My current code:</p>
  
  <pre><code>if (rand[0] == someInt &amp;&amp; rand[1] == someInt &amp;&amp; . . . &amp;&amp; rand[n] == someInt) {
  
      *do some things*
  
  }
  </code></pre>
  
  <p>I want this to work not knowing the length of <code>rand</code>.</p>