Function mapReverse

  • Reverses the order of entries in a Map.

    Type Parameters

    • K

    • V

    Parameters

    • map: Map<K, V>

      The Map to reverse.

    Returns Map<K, V>

    A new Map with the entries of the original Map in reverse order.

    Remarks

    This function creates a new Map with the entries of the original Map in reverse order. The original Map is not modified.

    Typeparam

    K - The type of the keys in the Map.

    Typeparam

    V - The type of the values in the Map.

    Example

    mapReverse(new Map([['a', 1], ['b', 2], ['c', 3]]));;
    //=> [['c', 3], ['b', 2], ['a', 1]]

Generated using TypeDoc