• Iterate an array sequentially, awaiting an async callback for each element before moving to the next (unlike Array.prototype.forEach, which does not await).

    Type Parameters

    • T

      The element type of the array.

    Parameters

    • array: T[]

      The array to iterate.

    • callback: (item: T, index: number, array: T[]) => Promise<void>

      Async callback invoked with each item, its index, and the array.

    Returns Promise<void>