Skip to content

each() function

Iterable/AsyncIterable을 반복하며 각각 차례대로 f에 적용합니다. (forEach)

Signature:

typescript
declare function each<A, B = unknown>(
  f: (a: A) => B,
  iterable: Iterable<A>,
): void;

Example

ts
each(console.log, [1, 2, 3]); // log 1, 2, 3

Try It

Open Source Code

Released under the Apache-2.0 License.