damd damd - 1 year ago 225
Javascript Question

Babel support for Object.entries

I'm looking at the stage 3 proposal of Object.values/Object.entries and I'd really like to use it in my current JavaScript project.

However, I can't figure out whether there's any Babel preset which supports it. Since the GitHub repository linked above says it's a stage 3 proposal, I assumed it would be part of babel-loader-stage-3, but it seems not.

Is there any Babel preset (or even plugin?) that lets me use Object.entries today?

Answer Source

What I did was install core-js and then just call this at the top of my file:


This made Object.entries available. Credits to @FelixKling.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download