title: What is more efficient when using a for loop?
body: <p>In a lot of for loops that work with arrays I see <code>i &lt; arr.length()</code> as the 2nd statement<br />
  Would this:<br />
  <code>for(i = 0; i &lt; arr.length(); i++){</code><br />
  <code>    //do something</code><br />
  <code>}</code><br />
  be LESS efficient than this:<br />
  <code>size = arr.length();</code><br />
  <code>for(i = 0; i &lt; size; i++){</code><br />
  <code>    //do something</code><br />
  <code>}</code>?<br />
  Or is the difference so small I shouldn't care?<br />
  This question only applies to languages that need to use a function in order to find the length of an array/list, unlike java, for example, which is object-oriented and arrays have a length propriety <code>arr.length</code></p>