# Function forEach

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

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

  #### Type Parameters

  - T

  #### Parameters

  - iterable: Iterable<T, any, any>

    The iterator to loop over.

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

    The iteration function.

    - - (x, index?): void

      - #### Parameters

        - x: T
        - `Optional` index: number

        #### Returns void