# Function forEach

- forEach<T>(iterable, f): Promise<void>

- The equivalent of Array.prototype.forEach for async iterators.

  #### Type Parameters

  - T

  #### Parameters

  - iterable: AsyncIterable<T, any, any>

    The async iterator to loop over.

  - f: ((x: T, index?: number) => void | PromiseLike<void>)

    The iteration function.

    - - (x, index?): void | PromiseLike<void>

      - #### Parameters

        - x: T
        - `Optional` index: number

        #### Returns void | PromiseLike<void>

  #### Returns Promise<void>