LoginSignup
9
13

More than 5 years have passed since last update.

ES6(esnext/es2015)をbabelでコンパイルした時にSymbol is not definedになった場合の対処法

Last updated at Posted at 2016-03-02

ES2015のfor ... ofループをbabelでコンパイルすると Symbol.Iteratorになるのですが
古いnode.jsのバージョンやIEでは対応してないのでエラーになります。

その場合はbabel-polyfillを使うことで対処できます。

$ npm install babel-polyfill
index.js
require("babel-polyfill"); // or import "babel-polyfill";
9
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
13