Function objReverse

  • Reverses the order of the properties in the given object.

    Type Parameters

    • V

    Parameters

    • obj: Record<ObjectKey, V>

      The object to reverse. The object's keys are of type ObjectKey and its values are of type V.

    Returns Record<ObjectKey, V>

    A new object with the properties of the input object in reverse order. The returned object's keys are of type ObjectKey and its values are of type V.

    Remarks

    This function does not mutate the original object. It returns a new object with the properties in reverse order.

    Typeparam

    V - The type of the values in the input object and the returned object.

    Example

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

Generated using TypeDoc