K
K
KnightForce2018-03-12 23:21:40
JavaScript
KnightForce, 2018-03-12 23:21:40

Is there a smart Polyfill?

It is necessary, depending on the version of the browser, to add something that is not there.
To make everything work on ES7 in the latest Chrome.
In an older version at the ES6 level.
And even older in ES5.
Option 2:
1) Connect 1 "smart".
2) Have multiple polyfills.
Question:
Which approach is better and what would you recommend?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2018-03-13
@KnightForce

Unfortunately, this does not happen. Polyfills only help to emulate some missing functionality. But the new syntax (arrow functions, declarations of variables through const, let, etc.) - alas, cannot be bypassed with a polyfill. You must first convert the code to ES5 when building the site. For this you need Babel.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question