The forEach() method executes a provided callback function once for each element of the supplied values.

  forEach: <Payload extends CommonPayload>(
    forEachCallback: ForEachCallback<any, Payload>,
    payload?: Payload
  ) => {
    isArray(values) &&
      isFunction(forEachCallback) &&
      values.forEach((value, index) =>
        forEachCallback(checkFn(value), value, index, values, payload)

Generic type variables


The Payload generic type variable constrained by generic type variable CommonPayload indicates the type of the payload parameter from which it gets its value.


forEachCallback: ForEachCallback<any, Payload>

A callback function of ForEachCallback type with parameters, the value that has been checked, the result of this check, index of each element, the provided values and payload of generic type variable Payload with optional properties from the provided payload, to handle.

payload?: Payload

An optional object of the generic type variable Payload is assigned to the payload of the given callback function.

Example usage

// Example usage.
import { areDeterminer } from '@angular-package/type';

Last updated