Given an iterable over [key,value] pairs, Object.fromEntries()
creates an object. It does the opposite of Object.entries. See the proposal1 for more information.
Syntax
console.log(
Object.fromEntries([
["foo", 1],
["bar", 2],
])
); // { foo: 1, bar: 2 }