title: Selecting specific elements from an array
body: <p>I’m trying to solve a tricky problem here. Whenever there are 3 rows together (e.g. 3A, 3B &amp; 3C), I want to increment the variable ‘count’. My logic only works for the first row but then fails for the rest. The answer to this problem should be 3. Can someone shed some light here?</p>
  
  <pre><code>function doThis() {
      var everySeat = [1A, 1B, 1C, 2A, 2C, 3A, 3B, 3C, 151A, 151B, 151C, 152B, 152C];
      var count;
  
      for (i = 1; i &lt;= everySeat.length; i++) {
          if (everySeat[i-1] = i + ‘A’ &amp;&amp; everySeat[i] = i + ‘B’ &amp;&amp; everySeat[i+1] = i + ‘C’) {
              count++;
          }
      }
  
  }
  
  doThis();
  </code></pre>