.overArgs(func, [transforms=[.identity]])
Creates a function that invokes func
with its arguments transformed.
Since
4.0.0
Arguments
func
(Function): The function to wrap.[transforms=[.identity]]
(…(Function|Function[]))_: The argument transforms.
Returns
(Function): Returns the new function.
Example
function doubled(n) {return n * 2;}function square(n) {return n * n;}var func = _.overArgs(function(x, y) {return [x, y];}, [square, doubled]);func(9, 3);// => [81, 6]func(10, 5);// => [100, 10]
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .