How do I install the babel-polyfill library?

后端 未结 7 1397
旧时难觅i
旧时难觅i 2020-12-02 06:13

I just started to use Babel to compile my ES6 javascript code into ES5. When I start to use Promises it looks like it\'s not working. The Babel website states support for pr

7条回答
  •  不知归路
    2020-12-02 06:54

    babel-polyfill allows you to use the full set of ES6 features beyond syntax changes. This includes features such as new built-in objects like Promises and WeakMap, as well as new static methods like Array.from or Object.assign.

    Without babel-polyfill, babel only allows you to use features like arrow functions, destructuring, default arguments, and other syntax-specific features introduced in ES6.

    https://www.quora.com/What-does-babel-polyfill-do

    https://hackernoon.com/polyfills-everything-you-ever-wanted-to-know-or-maybe-a-bit-less-7c8de164e423

提交回复
热议问题