for..of support

TypeScript 1.5 adds support to ES6 for..of loops on arrays for ES3/ES5 as well as full support for Iterator interfaces when targetting ES6.

Example

The TypeScript compiler will transpile for..of arrays to idiomatic ES3/ES5 JavaScript when targeting those versions:

  1. for (var v of expr) { }

will be emitted as:

  1. for (var _i = 0, _a = expr; _i < _a.length; _i++) {
  2. var v = _a[_i];
  3. }