0

I have sample code that works fine in Chrome but IE11 has problem because of Object.assign method and => sign.

Here is my code below and I don't know how to design it for IE11:

 let dictionary = Object.assign({}, ...tempGroups[tempKey].map((x) => ({ [x.ID]: x.Value })));

Thanks for helping.

Himelu5
  • 15
  • 3
  • You use babel compiler to convert code in ES5 try: https://babeljs.io/repl# – xdeepakv Sep 23 '21 at 09:48
  • Does this answer your question? [How do I get Babel 6 to compile to ES5 javascript?](https://stackoverflow.com/questions/34747693/how-do-i-get-babel-6-to-compile-to-es5-javascript) – xdeepakv Sep 23 '21 at 09:50

1 Answers1

0

Object.assign is not suppported for IE-11. Try to replicate that using a loop since you are using map anyways.

Also instead of arrow functions you can use normal functions.

let dictionary = {};
tempGroups[tempKey].forEach(
function(x) {
 dictionary[x.ID] =  x.Value; 
});
Tushar Shahi
  • 16,452
  • 1
  • 18
  • 39