Skip to content

invert

Returns a new object whose keys are the values of the given object and its values are the keys of the given object.

Usage

const a = { a: 1, b: 2, c: 3 };
invert(a); // => { 1: 'a', 2: 'b', 3: 'c' }

Installation

Terminal window
npx atmx add helper invert