mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-21 19:16:23 +00:00
539 B
539 B
date | id | title |
---|---|---|
2020-11-16 | 87eebd15-af30-482c-83be-d9f77ecf83d0 | Object.fromEntries |
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 }