You-Dont-Need-Lodash-Underscore icon indicating copy to clipboard operation
You-Dont-Need-Lodash-Underscore copied to clipboard

_.invert

Open erossignon opened this issue 4 years ago • 0 comments

Here is a suggestion for _.invert

const a = { b:"C" , d: "E"};
const invertA = Object.entries(a).reduce((c,[k,v])=> { c[v]=k; return c; }, {});
// {C:"b", E:"d" }

erossignon avatar Sep 22 '20 19:09 erossignon