@teambit/harmony
Version:
abstract extension system
11 lines (10 loc) • 307 B
text/typescript
/**
* asynchronously iterate an array.
* :TODO improve function singature
*/
export async function asyncForEach(array: any[], callback: any) {
for (let index = 0; index < array.length; index += 1) {
// eslint-disable-next-line no-await-in-loop
await callback(array[index], index, array);
}
}