Array.each

Array.each

Array.each

Function

Iterate through the array and execute callbacks.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
callbackFnNoEmptyThe callback signature is fn(value, index, current).

Return value

TypeDescription
ArrayReturns the original array to facilitate continued chain calls.

Example

Notes

  • The traversal source is a shallow copy of the array at the time of the call.
  • When the callback is not a function, no error is raised and its result is treated as Null.