Lodash - 函数
Lodash 有许多易于使用的方法,有助于创建和处理函数。本章将详细讨论这些方法。
Lodash 提供各种方法来处理函数,如下所示:
| 序号 | 方法和语法 |
|---|---|
| 1 |
_.ary(func, [n=func.length]) |
| 2 |
_.before(n, func) |
| 3 |
_.bind(func, thisArg, [partials]) |
| 4 |
_.bindKey(object, key, [partials]) |
| 5 |
_.curry(func, [arity=func.length]) |
| 6 |
_.curryRight(func, [arity=func.length]) |
| 7 |
_.delay(func, wait, [args]) |
| 8 |
_.flip(func) |
| 9 |
_.memoize(func, [resolver]) |
| 10 |
_.negate(predicate) |
| 11 |
_.once(func) |
| 12 |
_.overArgs(func, [transforms=[_.identity]]) |
| 13 |
_.partial(func, [partials]) |
| 14 |
_.partialRight(func, [partials]) |
| 15 |
_.rearg(func, indexes) |
| 16 |
_.rest(func, [start=func.length-1]) |
| 17 |
_.spread(func, [start=0]) |
| 18 |
_.unary(func) |
| 19 |
_.wrap(value, [wrapper=identity]) |
广告