AJSF API reference
    Preparing search index...

    Function forEach

    • 'forEach' function

      Iterates over all items in the first level of an object or array and calls an iterator funciton on each item.

      The iterator function is called with four values:

      1. The current item's value
      2. The current item's key
      3. The parent object, which contains the current item
      4. The root object

      Setting the optional third parameter to 'top-down' or 'bottom-up' will cause it to also recursively iterate over items in sub-objects or sub-arrays in the specified direction.

      // {Object|Array} object - The object or array to iterate over // {function} fn - the iterator funciton to call on each item // {boolean = false} errors - Show errors? // {void}

      Parameters

      • object: any
      • fn: (v: any, k?: string | number, c?: any, rc?: any) => any
      • recurse: string | boolean = false
      • rootObject: any = object
      • errors: boolean = false

      Returns void