Last active
April 23, 2019 20:00
-
-
Save shisama/f86b94b762fc1a565d2ab7d04035098f to your computer and use it in GitHub Desktop.
Object.fromEntries - New JavaScript Features in Node.js v12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const entries = new Map([ | |
['foo', 'bar'], | |
['baz', 42] | |
]); | |
const obj = Object.fromEntries(entries); | |
console.log(obj); | |
// expected output: Object { foo: "bar", baz: 42 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment