I have an extremely large JSON object structured like this:
{A : 1, B : 2, C : 3, D : 4}
I need a function that can swap the values with
Using ES6:
const obj = { a: "aaa", b: "bbb", c: "ccc", d: "ffffd" }; Object.assign({}, ...Object.entries(obj).map(([a,b]) => ({ [b]: a })))