Returns a function that invokes a provided function with reordered arguments.
second argument must be an array of nonnegative integers
input function
argument indices
function context
function with reordered arguments
function foo( a, b, c ) { return [ a, b, c ]; } var bar = reorderArguments( foo, [ 2, 0, 1 ] ); var out = bar( 1, 2, 3 ); // returns [ 3, 1, 2 ]
Returns a function that invokes a provided function with reordered arguments.
second argument must be an array of nonnegative integers