ForEachCallback

ForEachCallback<Value, Payload>

Represents a callback function of .forEach() method which is executed once for each element.

foreach-callback.type.ts
type ForEachCallback<Value = any, Payload = object> = (
  result: boolean,
  value: Value,
  index?: number,
  array?: any[],
  payload?: Payload
) => void;

Generic type variables

Value=any

A generic type variable Value determines the type of the value parameter, by default anyarrow-up-right.

Payload=object

The shape of the optional payload parameter, by default objectarrow-up-right.

Parameters

result: boolean

The result of the check of a booleanarrow-up-right type.

value: Value

The value that has been checked of a generic type variable Value.

index: number

An optional numberarrow-up-right of checked array element.

array: any[]

An optional array of anyarrow-up-right type that each element is checked.

payload?: Payload

An optional objectarrow-up-right of a generic type variable Payload to provide more data.

Return type

The return value is void.

Last updated