Array
/ API ReferenceArray
/ API Referenceeach
Iterates over each value in the array.
Similar to Array.prototype.forEach.
The Gist
import { each } from '@weser/array'
each([1, 2, 3], (value) => console.log(value))
// 1
// 2
// 3
Parameters
| Parameter | Type | Description |
|---|---|---|
| arr | Array<T> | The array to iterate over. |
| iterator | (value: T, index: number, length: number, arr: Array<T>) => void | The iterator method with the signature. |
© 2024-present Robin Weser. All Rights Reserved.