7 lines
149 B
JavaScript
7 lines
149 B
JavaScript
|
module.exports = function fromEntries (iterable) {
|
||
|
return [...iterable].reduce((obj, [key, val]) => {
|
||
|
obj[key] = val
|
||
|
return obj
|
||
|
}, {})
|
||
|
}
|