Comment Comment by djfm Shouldn't it be ".map(([prop, value]) => ...)" ?I like to write it this way, using as much syntax sugar as possible:const mapObject = fn => obj => Object.assign( ...Object.entries(obj).map( ([key, value]) => ({ [key]: fn(value) }) ) ); parent djfm 9 years ago
I like to write it this way, using as much syntax sugar as possible:
const mapObject = fn => obj => Object.assign( ...Object.entries(obj).map( ([key, value]) => ({ [key]: fn(value) }) ) );