Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
IE11 compatible Object.fromEntries

So I'm looking to make my ES6 JavaScript code compatible with IE11, but I'm having some issues.

Here is the return for var res inside Google Chrome: enter image description here

Tip: category is the key, result[category] is the value.

Here is the code that I have:

for (var category in result) {
    var res = Object.fromEntries(Object.keys(result[category]).filter(x => x !== 'Other').concat('Other').map(x => [x, result[category][x]]));
    console.log(res);
}

Could someone guide me in the right direction on how I would be able to make var res compatible with IE11? Looks like Object.fromEntries and Object.keys might not be supported.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can polyfill Object.fromEntries using a simple for loop.

function fromEntries(entries){
    var res = {};
    for(var i = 0; i < entries.length; i++) res[entries[i][0]] = entries[i][1];
    return res;
}
if(!Object.fromEntries) Object.fromEntries = fromEntries;
console.log(fromEntries([['a', 1], ['b', 2]]))

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!