Inverts the keys and values of an object.
Converts all values to strings and uses them as keys in the resulting object.
The object whose keys and values will be inverted.
A new object with keys and values swapped.
const obj = { a: "1", b: "2" };const inverted = invert(obj);console.log(inverted); // { "1": "a", "2": "b" } Copy
const obj = { a: "1", b: "2" };const inverted = invert(obj);console.log(inverted); // { "1": "a", "2": "b" }
1.1.0
Inverts the keys and values of an object.
Converts all values to strings and uses them as keys in the resulting object.