2023-12-26 06:07:37 +01:00
..
2022-06-02 23:26:10 +08:00
2023-12-26 06:07:37 +01:00

Flip medium #object

by Farhan Kathawala @kathawala

Take the Challenge

Implement the type of just-flip-object. Examples:

Flip<{ a: "x", b: "y", c: "z" }>; // {x: 'a', y: 'b', z: 'c'}
Flip<{ a: 1, b: 2, c: 3 }>; // {1: 'a', 2: 'b', 3: 'c'}
Flip<{ a: false, b: true }>; // {false: 'a', true: 'b'}

No need to support nested objects and values which cannot be object keys such as arrays


Back Share your Solutions Check out Solutions