- forEach<T>(it, fn, options?): undefined | Promise<void>
Parameters
- it: T[] | AsyncIterable<T> | Iterable<T>
- fn: ((v: undefined | T) =>
| boolean
| void
| Promise<void>
| Promise<boolean>)- (v):
| boolean
| void
| Promise<void>
| Promise<boolean> Returns
| boolean
| void
| Promise<void>
| Promise<boolean>
- options: Partial<ForEachOptions> = {}
Returns undefined | Promise<void>
Execute function
f
for each item in iterable. Iff
returns false, iteration stops.When using an async iterable,
fn
can also be async.