Type Parameters

  • T

Hierarchy

Implements

Constructors

Properties

_array: T[]

Accessors

Methods

  • Returns true if any of the items match the predicate, otherwise false

    Parameters

    Returns boolean

    Example

    if (myEnumerable.any()) {
    // do something because the enumerable has elements
    }
    let myEnumerable = new ArrayEnumerable([1, 2, 3, 4]);
    if (myEnumerable.any((i) => i == 2)) {
    // the enumerable contains a '2'
    }
  • Copies the elements of the ICollection to an Array, starting at a particular Array index.

    Parameters

    • array: T[]

      The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing.

    • arrayIndex: number

      The zero-based index in array at which copying begins.

    Returns void

  • Parameters

    • obj: T
    • isEquivilent: boolean = false

    Returns undefined | T

  • Iterates over the enumerable and performs the callback on each item. Return false to break.

    Parameters

    • callback: ((value, index) => boolean | void)
        • (value, index): boolean | void
        • Parameters

          • value: T
          • index: number

          Returns boolean | void

    Returns void

  • Returns a single element only if there is one element in the enumerable. If there are no items in the enumerable, then null is returned

    Parameters

    Returns null | T

    Throws

    InvalidOperationException if there is not exactly one or zero items in the enumerable

Generated using TypeDoc