Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
149
rated 0 times [  151] [ 2]  / answers: 1 / hits: 25854  / 9 Years ago, fri, january 29, 2016, 12:00:00

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-preset-stage-3, but it seems not.



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


More From » babeljs

 Answers
34

Using babel, installing




  1. babel-preset-env

  2. babel-plugin-transform-runtime



gives support for Object.values/Object.entries as well as other *ES20** functionality.



As per recommendation by the modules, configure .babelrc with the following:



{
plugins: [transform-runtime],
presets: [env]
}

[#63510] Wednesday, January 27, 2016, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
braidenv

Total Points: 80
Total Questions: 104
Total Answers: 91

Location: Peru
Member since Fri, Oct 14, 2022
2 Years ago
;