Array that adds elements in sorted order.

Comparator is always called like: comparator(itemFromSortedArray, yourItem)

Type Parameters

  • T

Constructors

Properties

Accessors

Methods

Constructors

  • Type Parameters

    • T

    Parameters

    • array: T[] = []
    • comparator: (a: T, b: T) => number

    Returns SortedArray<T>

Properties

comparator: (a: T, b: T) => number
raw: T[]

Accessors

  • get length(): number
  • Returns number

Methods

  • Returns void

  • Parameters

    • item: T

    Returns null | T

  • Parameters

    • item: T

    Returns boolean

  • Parameters

    • item: T
    • closest: boolean = false

    Returns number

  • Parameters

    • item: T | T[]

    Returns number

  • Parameters

    • item: T

    Returns void