Skip to content

Instantly share code, notes, and snippets.

@shisama
Last active April 23, 2019 20:00
Show Gist options
  • Save shisama/f86b94b762fc1a565d2ab7d04035098f to your computer and use it in GitHub Desktop.
Save shisama/f86b94b762fc1a565d2ab7d04035098f to your computer and use it in GitHub Desktop.
Object.fromEntries - New JavaScript Features in Node.js v12
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