Compile ES2015 for...of to ES5
$ npm install babel-plugin-transform-es2015-for-of
.babelrc
// without options
{
"plugins": ["transform-es2015-for-of"]
}
// with options
{
"plugins": [
["transform-es2015-for-of", {
"loose": true
}]
]
}
$ babel --plugins transform-es2015-for-of script.js
require("babel-core").transform("code", {
plugins: ["transform-es2015-for-of"]
});