[Go to site: main page, start]

Function invertObject

  • Invert an object by assigning its values as keys and its keys as values.

    Parameters

    • obj: object

      The original object to invert

    Returns object

    The inverted object with keys and values swapped