title: For VS Foreach on Array performance (in AS3/Flex)
body: <p>Which one is faster? Why?</p>
  
  <pre><code>var messages:Array = [.....]
  
  // 1 - for
  var len:int = messages.length;
  for (var i:int = 0; i &lt; len; i++) {
      var o:Object = messages[i];
      // ...
  }
  
  // 2 - foreach
  for each (var o:Object in messages) {
      // ...
  }
  </code></pre>