Skip to main content

CommonEnumerate

Callable

  • CommonEnumerate<T>(iterable: Iterable<T>, start?: number, step?: number): Generator<[index: number, value: T], void, any>

  • Iterate through the passed iterable and yield index/value pairs.


    Type parameters

    • T

    Parameters

    • iterable: Iterable<T>

      The to-be iterated iterable

    • start: number = 0

      The starting index

    • step: number = 1

      The step size in which the index is incremented

    Returns Generator<[index: number, value: T], void, any>