• Execute a callback function for every element in an array.

    Type Parameters

    • T = any

    Parameters

    • nodeList: ArrayLike<T>

      List to iterate through

    • callback: ((itm, i) => void)

      Callback (It is passed each item of nodeList and its index)

        • (itm, i): void
        • Parameters

          • itm: T
          • i: number

          Returns void

    Returns void

    Example

    forEach(arr, function (item, idx) { ... });
    

    Method

    forEach