Here’s a version that doesn’t use reduce:
Object.fromEntries( a_list.map( x => [key_maker(x), value_maker(x)]) );
Object.fromEntries is basically the same as _.fromPairs in Lodash. This feels the most like the Python dict comprehension to me.
Here’s a version that doesn’t use reduce:
Object.fromEntries( a_list.map( x => [key_maker(x), value_maker(x)]) );
Object.fromEntries is basically the same as _.fromPairs in Lodash. This feels the most like the Python dict comprehension to me.