ForEachCallback
ForEachCallback<Value, Payload>
ForEachCallback<Value, Payload>Represents a callback function of .forEach() method which is executed once for each element.
type ForEachCallback<Value = any, Payload = object> = (
result: boolean,
value: Value,
index?: number,
array?: any[],
payload?: Payload
) => void;Generic type variables
Value=any
Value=anyA generic type variable Value determines the type of the value parameter, by default any.
Payload=object
Payload=objectThe shape of the optional payload parameter, by default object.
Parameters
result: boolean
result: booleanThe result of the check of a boolean type.
value: Value
value: ValueThe value that has been checked of a generic type variable Value.
index: number
index: numberAn optional number of checked array element.
array: any[]
array: any[]An optional array of any type that each element is checked.
payload?: Payload
payload?: PayloadAn optional object of a generic type variable Payload to provide more data.
Return type
The return value is void.
Last updated
Was this helpful?