MiguelCastillo / belty

General purpose utility belt
MIT License
0 stars 0 forks source link

added the ability for the mapper function to return an array of key v… #58

Closed MiguelCastillo closed 6 years ago

MiguelCastillo commented 6 years ago

…alue entires to build the map with custom keys and values

The following example will generate a map with keys that are value * 2 and the mapped value is just the value itself.

arrayToMap([1, 2, 3], (value) => [value * 2, value])