What can I do if IE is not supported?

I have an arrow function that works fine on Chrome / Firefox, but I also need it to work on IE11, and I don't know what else to do.

Here you can see that arrow functions are not supported in IE11, so I tried changing my code from ES6 to ES5 here , because I read that this could solve the problems (you can also check my code from the link :) to remove arrow functions .

Object.entries is also not supported, and I still need it. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

So I tried using the polyfill link above, but uses Reflect, which is also not supported. https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Reflect

Any ideas? I really got lost with IE11 dev. PD: The code still works in Chrome / Firefox.

+4
source share
3 answers

This is a naive implementation of Object.entries.
It works well for all examples at https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

Object.entries = Object.entries || function(obj) {
   return Object.keys(obj).map(function(k) {
       return [k, obj[k]];
   });
};
+2
source

babel with a pre-set babel this will be the way to go.

, , , babel ( ES5) , .

+1

ES8 + .

Webpack babel-transformers polyfills, . create-react-app next.js.

, IE11 , E2E/ SauseLabs, , TestCafe NightWatch.

0

Source: https://habr.com/ru/post/1681680/


All Articles