Array
/ API Reference
Array
/ API Reference

each

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

ParameterTypeDescription
arrArray<T>The array to iterate over.
iterator(value: T, index: number, length: number, arr: Array<T>) => voidThe iterator method with the signature.
On this page