创建一个函数。 该函数调用 func,并传入预设的 partials 参数。 这个方法类似_.bind,除了它不会绑定 this。
需要预设的函数
预设的参数
返回预设参数的函数。
const greet = (greeting, name) => `${greeting} ${name}!`;const sayHello = partial(greet, 'Hello');sayHello('John'); // => 'Hello John!' Copy
const greet = (greeting, name) => `${greeting} ${name}!`;const sayHello = partial(greet, 'Hello');sayHello('John'); // => 'Hello John!'
创建一个函数。 该函数调用 func,并传入预设的 partials 参数。 这个方法类似_.bind,除了它不会绑定 this。