Class Helpers

Hierarchy

  • Helpers

Constructors

Methods

  • Gets the element from the given collection with the largest value returned by getValue. If the collection is empty, returns undefined.

    Type Parameters

    • T

    Parameters

    • collection: Iterable<T>
    • getValue: ((item) => number)
        • (item): number
        • Parameters

          • item: T

          Returns number

    Returns T

  • Gets the element from the given collection with the smallest value returned by getValue. If the collection is empty, returns undefined.

    Type Parameters

    • T

    Parameters

    • collection: Iterable<T>
    • getValue: ((item) => number)
        • (item): number
        • Parameters

          • item: T

          Returns number

    Returns T

  • Parameters

    • e: any

    Returns void

  • Sorts the given array in place, ensuring that equivalent items maintain the same ordering. Returns the same array as was passed in.

    Type Parameters

    • T

    Parameters

    • array: T[]

      Array to sort.

    • compareFn: ((a, b) => number)
        • (a, b): number
        • Parameters

          • a: T
          • b: T

          Returns number

    Returns T[]

    The same array as was passed in, now sorted.

Generated using TypeDoc