Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/for-each/docs/types/index.d"

Index

Functions

Functions

Export assignment forEach

  • Invokes a function once for each element in a collection.

    Notes

    • When invoked, the input function is provided three arguments:

      • value: collection value
      • index: collection index
      • collection: the input collection

    Parameters

    • collection: Collection

      input collection

    • fcn: Function

      function to invoke

    • Optional thisArg: any

      execution context

    Returns Collection

    input collection

    Example

    function log( v, index, collection ) {
        console.log( '%s: %d', index, v );
    }
    
    var arr = [ 1, 2, 3, 4 ];
    
    forEach( arr, log );