主题
flip
js
_.flip(func)
创建一个函数,使用反转的参数调用 func
。
¥Creates a function that invokes func
with arguments reversed.
新增于
¥Since
4.0.0
参数
¥Arguments
func
(函数):翻转参数的函数。¥
func
(Function): The function to flip arguments for.
返回
¥Returns
(函数):返回新的翻转函数。
¥(Function): Returns the new flipped function.
示例
¥Example
js
var flipped = _.flip(function() {
return _.toArray(arguments);
});
flipped('a', 'b', 'c', 'd');
// => ['d', 'c', 'b', 'a']