Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment pickArguments

  • pickArguments(fcn: Function, indices: ArrayLike<number>, thisArg?: any): Function
  • Returns a function that applies specified arguments to a provided function.

    Parameters

    • fcn: Function

      input function

    • indices: ArrayLike<number>

      argument indices

    • Optional thisArg: any

      function context

    Returns Function

    function wrapper

    Example

    function foo( a, b ) {
        return [ a, b ];
    }
    
    var bar = pickArguments( foo, [ 0, 2 ] );
    
    var out = bar( 1, 2, 3 );
    // returns [ 1, 3 ]