Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 655 Bytes

fromEntries.md

File metadata and controls

33 lines (21 loc) · 655 Bytes

objects.fromEntries

fromEntries(array)

FromEntries takes an array of arrays with key-value pairs and returns an object composed from key-value pairs.

Arguments

  1. array (Array): input key-value pairs in an array of arrays

Returns

(object): an object composed from the key-value pairs

Example

const result = objects.fromEntries([['age', 12034], ['name', 'Trair'],['state', 'Floating']]);
console.log(result);
> { age: 12034, name: 'Trair', state: 'Floating' }