forEach()

areDefined().forEach()

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

The method uses forEach() method of areDeterminer().

Example usage

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

let age;

areDefined('1', 2, null, undefined, age).forEach(
  (result, value, index, array, payload) => {
    result // true, true, true, false, false
    value // '1', 2, null, undefined, undefined
    index // 0, 1, 2, 3, 4
    array // [ '1', 2, null, undefined, undefined ]
    payload // { age: 2 }
  },
  { age: 2 }
);

Last updated