Skip to content

partial

创建函数的偏函数

68 bytes
since v12.1.0

使用方法

通过提供给定函数需要的部分或全部参数来创建偏函数。

import * as _ from "radashi";
const add = (a: number, b: number) => a + b;
const addFive = _.partial(add, 5);
addFive(2); // => 7