Prism · Objects

$fromEntries

Turns a list of [key, value] pairs into an object. The opposite of $entriesOf.

The source
{ pairs: [['x', 1], ['y', 2]] }
The config
{ $fromEntries: { $ref: '$.pairs' } }
What comes out
{ x: 1, y: 2 }
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.