title: Does this for loop iterate multiple times?
body: <p>I have been discussing some code with colleagues:</p>
  
  <pre><code>for(const a of arr) {
    if(a.thing)
      continue;
    // do a thing
  }
  </code></pre>
  
  <p>A suggestion was to filter this and use a forEach</p>
  
  <pre><code>arr.filter(a =&gt; !a.thing)
    .forEach(a =&gt; /* do a thing */);
  </code></pre>
  
  <p>There was a discussion about iterating more than necessary. I've looked this up, and I can't find anything. I also tried to figure out how to view the optimized output, but I don't know how to do that either.</p>
  
  <p>I would expect that the <code>filter</code> and <code>forEach</code> turn into code that is very much like the <code>for of</code> with the <code>continue</code>, but I don't know how to be sure. </p>
  
  <p>How can I find out? The only thing I've tried so far is google.</p>