Polyfill for Object.fromEntries doesn't work for arrays
See original GitHub issue[Bug Report]
What
Polyfill for Object.fromEntries
only works for maps, but not arrays in IE11.
Details
Example:
const arrayTest = [['foo', 'bar'], ['baz', 42]];
// Gets an error: [object, undefined] is not a function
const objectTest = Object.fromEntries(arrayTest);
// Works
const objectTest1 = Object.fromEntries(new Map(arrayTest));
Browser: IE11 OS: Windows 10 on virtualBox VM
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Object.fromEntries() - JavaScript - MDN Web Docs
An iterable, such as an Array or Map , containing a list of objects. Each object should have two properties: 0. A string...
Read more >Add ES2019 Object.fromEntries function · Issue #30933 - GitHub
It looks to me that in tsconfig.json , the setting to use is target: "es2019" or greater. This means it won't work in...
Read more >Unable to polyfill Object.fromEntries in Ember - Stack Overflow
fromEntries is not a function" and Safari 12 works fine on the page that uses it. When I use Safari dev tools I...
Read more >The Object.fromEntries() method in vanilla JS - Go Make Things
fromEntries() method doesn't work on all iterables. The iterable must represent a key/value pair. That means it will work for FormData and Map() ......
Read more >Introducing Object.fromEntries - DEV Community
One of the great things about this function is that it works on all iterables. That means you can turn an Array into...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We support this case as well, which the test shows. @JiahuanWu, does your polyfill.io include
Object.fromEntries
in thefeatures
query parameter?@JakeChampion Sorry for late response. My data is just as simple as the test. And I tried on Parallels, it works fine. So I suppose it’s a problem of VirtualBox.
Thanks for your time. I’ll close the issue.