@tempots/std

forEachElement() function

Applies a function to each element in an array.

Signature:

forEachElement: (arr: T[], f: (v: T) => void) => void

Parameters

Parameter

Type

Description

arr

T[]

The array to iterate over.

f

(v: T) => void

The function to apply to each element.

Returns: void