Function sortByValueProperty

Returns an array of entries from a map, sorted by a property of the value

cosnt m = new Map();
m.set(`4491`, { name: `Bob` });
m.set(`2319`, { name: `Alice` });
const sorted = Maps.sortByValue(m, `name`);
  • Type Parameters

    • K
    • V
    • Z

    Parameters

    • map: ReadonlyMap<K, V>

      Map to sort

    • property: string

      Property of value

    • OptionalcompareFunction: ((a: Z, b: Z) => number)

      Comparer. If unspecified, uses a default.

        • (a, b): number
        • Parameters

          Returns number

    Returns [K, V][]