_.spread(func, [start=0])
创建一个函数,调用func
时,this
绑定到创建的新函数,把参数作为数组传入,类似于Function#apply
.
const_=require('lodash'); varsay=_.spread(function (who, what) { returnwho+' says '+what; }); console.log(say(['fred', 'hello']))
创建一个函数,调用func
时,this
绑定到创建的新函数,把参数作为数组传入,类似于Function#apply
.
const_=require('lodash'); varsay=_.spread(function (who, what) { returnwho+' says '+what; }); console.log(say(['fred', 'hello']))