It\'s all in the title, really.
In the Babel documentation, there is the following line on the page describing babel-runtime
Another purpose o
If you don't care about polluting global scope, the polyfill is the better option: the runtime does not work with instance methods such as [0, 1, 2].includes(1)
, while the polyfill will.
The main difference between the two is that the polyfill pollutes global scope, and works with instance methods, while the runtime does not pollute global scope and does not work with instance methods.
The polyfill also will not allow you to include two separate versions of itself into your code. This is only a problem if two separate polyfills are being required/imported somewhere in your code.