4.17.11
3.10.1
2.4.2
1.3.1

_.flip(func)

Creates a function that invokes func with arguments reversed.

Since

4.0.0

Arguments

argument
func
type
Function
description
The function to flip arguments for.

Returns

(array)

Example

var flipped = _.flip(function () {
  return _.toArray(arguments);
});

flipped("a", "b", "c", "d");
// => ['d', 'c', 'b', 'a']
var flipped = _.flip(function () {
  return _.toArray(arguments);
});

flipped("a", "b", "c", "d");
// => ['d', 'c', 'b', 'a']