Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/map-arguments/docs/types/index.d"

Index

Functions

Functions

Export assignment mapArguments

  • mapArguments(fcn: Function, clbk: Function, thisArg?: any): Function
  • Returns a function that applies arguments to a provided function after transforming arguments according to a callback function.

    Notes

    • The callback function is provided the following arguments:

      • value: argument value.
      • index: argument index.

    Parameters

    • fcn: Function

      input function

    • clbk: Function

      callback function

    • Optional thisArg: any

      input function context

    Returns Function

    function wrapper

    Example

    function foo( a, b, c ) {
        return [ a, b, c ];
    }
    
    function clbk( v ) {
        return v * 2;
    }
    
    var bar = mapArguments( foo, clbk );
    
    var out = bar( 1, 2, 3 );
    // returns [ 2, 4, 6 ]