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

  • 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

  • Modifies the current set so that it contains only elements that are also in a specified collection.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns void

  • Determines whether a set is a subset of a specified collection.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns boolean

    true if the current set is a subset of other; otherwise, false.

  • Determines whether the current set is a superset of a specified collection.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns boolean

    true if the current set is a superset of other; otherwise, false.

  • Determines whether the current set overlaps with the specified collection.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns boolean

    true if the current set and other share at least one common element; otherwise, false.

  • Determines whether the current set and the specified collection contain the same elements.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns boolean

    true if the current set is equal to other; otherwise, false.

  • 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

  • Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns void

  • Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both.

    Parameters

    • enumerable: IEnumerable<T>

      The collection to compare to the current set.

    Returns void

Generated using TypeDoc