完成代码迁移
for-of statement transformer which only support array or array-like object.
es2015 for-of statement support Array, Iterators and Generators. because Iterators and Generators can’t shim easily, we just support Array or Array-like Object.
$ npm install babel-plugin-transform-for-of-array --save-dev
.babelrc
{ "plugins": ["transform-for-of-array"] }
$ babel --plugins transform-for-of-array script.js
require("babel-core").transform("code", { plugins: ["transform-for-of-array"] });
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
babel-plugin-transform-for-of-array
for-of statement transformer which only support array or array-like object.
Difference
es2015 for-of statement support Array, Iterators and Generators. because Iterators and Generators can’t shim easily, we just support Array or Array-like Object.
Installation
Usage
Via
.babelrc(Recommended).babelrc
Via CLI
Via Node API