Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 6
    You may add some explanation with the code you posted instead of posting a plain code which might be not understandable. Commented Aug 17, 2018 at 12:30
  • 1
    Object.entries pulls out an array of arrays based on the key/value pairs of the original object: [['a', 1],['b',2],['c',3]]. The forEach deconstructs each of the key/value arrays and sets the two variables to key and value, to be used as you want the in function - here output in console.log. Commented Nov 18, 2019 at 22:16