Underscore.JS 函数
Underscore.JS有很多易于使用的方法来处理函数。本章将详细讨论这些方法。
Underscore.JS提供了以下各种方法来处理函数:
| 序号 | 方法和语法 |
|---|---|
| 1 | bind _.bind(function, object, *arguments) |
| 2 | partial _.partial(function, *arguments) |
| 3 | memoize _.memoize(function, [hashFunction]) |
| 4 | delay _.delay(function, wait, *arguments) |
| 5 | once _.once(function) |
| 6 | before _.before(count, function) |
| 7 | wrap _.wrap(function, wrapper) |
| 8 | negate _.negate(predicate) |
| 9 | compose _.compose(*functions) |
极客教程