Loops
/ API ReferenceLoops
/ API ReferencearrayEach
Iterates over each value in the array.
Similar to Array.prototype.forEach
.
The Gist
import { arrayEach } from '@weser/loops'
arrayEach([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.