December 2017
Beginner to intermediate
376 pages
7h 53m
English
The ES2015 proposal includes new syntax, but also new APIs, such as Promise, and additions to existing APIs, such as Array and Object.
The Webpack Babel plugin can transpile ES2015 syntax, but new API methods require polyfilling. A polyfill is a script that is run in the browser to cover an API or API method that may be missing.
For example, Object.assign is a new API method that is not supported in Internet Explorer 11. If we want to use it in our frontend app, we have to check at the top of our script whether the API method exists, and if not, we define it manually with a polyfill:
if (typeof Object.assign != 'function') { // Polyfill to define Object.assign }
Speaking of which, Object.assign is a handy way of merging objects ...
Read now
Unlock full access