title: How to do it more efficiently?
body: <p>Let's imagine we should get some data...</p>
  
  <pre><code>var data = [];
  
  //some code omitted that might fill in the data (though might not)
  </code></pre>
  
  <p>Then we need to do something with the data. And my question is how to do it more effectively. <b>Like so?:</b></p>
  
  <pre><code>if (data.length) {
      for (var i = 0; i &lt; data.length; i++) {
          //iterate over the data and do something to it
      }
  }
  </code></pre>
  
  <p><b>Or just like so?:</b></p>
  
  <pre><code>for (var i = 0; i &lt; data.length; i++) {
      //iterate over the data and do something to it
  }
  </code></pre>
  
  <p>The point is whether to check the length before iterating or not?</p>