Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "source/System/Collections/Enumeration/Enumerator"

Index

Functions

forEach

  • Flexible method for iterating any enumerable, enumerable, array, or array-like object.

    Type parameters

    • T

    Parameters

    • e: IEnumerableOrArray | IEnumerator<T> | IIterator<T>

      The enumeration to loop on.

    • action: function

      The action to take on each.

        • (element: T, index?: number): any
        • Parameters

          • element: T
          • Optional index: number

          Returns any

    • Default value max: number = Infinity

      Stops after max is reached. Allows for forEach to be called on infinite enumerations.

    Returns number

    the total times iterated. If the enumerable is unrecognized then -1.

from

isEnumerable

  • isEnumerable<T>(instance: any): boolean
  • Type parameters

    • T

    Parameters

    • instance: any

    Returns boolean

isEnumerableOrArrayLike

  • isEnumerableOrArrayLike<T>(instance: any): boolean
  • Type parameters

    • T

    Parameters

    • instance: any

    Returns boolean

isEnumerator

  • isEnumerator<T>(instance: any): boolean
  • Type parameters

    • T

    Parameters

    • instance: any

    Returns boolean

isIterator

  • isIterator<T>(instance: any): boolean
  • Type parameters

    • T

    Parameters

    • instance: any

    Returns boolean

map

  • Converts any enumerable to an array of selected values.

    Type parameters

    • T

    • TResult

    Parameters

    • source: IEnumerableOrArray | IEnumerator<T>
    • selector: Selector<T, TResult>
    • Default value max: number = Infinity

      Stops after max is reached. Allows for forEach to be called on infinite enumerations.

    Returns TResult[]

throwIfEndless

  • throwIfEndless(isEndless: boolean): void
  • Parameters

    • isEndless: boolean

    Returns void

toArray

  • Converts any enumerable to an array.

    Type parameters

    • T

    Parameters

    • source: IEnumerableOrArray | IEnumerator<T>
    • Default value max: number = Infinity

      Stops after max is reached. Allows for forEach to be called on infinite enumerations.

    Returns T[]

Generated using TypeDoc