Underscore.JS-ユーティリティ
Underscore.JSには、使いやすいユーティリティメソッドが多数あります。この章では、それらについて詳しく説明します。
Underscore.JSは、以下に示すさまざまなユーティリティメソッドを提供します-
| シニア番号 | メソッドと構文 |
|---|---|
| 1 | 身元 _.identity(value) |
| 2 | 絶え間ない _.constant(value) |
| 3 | noop _.noop() |
| 4 | タイムズ _.times(n、iteratee、[context]) |
| 5 | ランダム _.random(min、max) |
| 6 | 混入します _.mixin(object) |
| 7 | iteratee _.iteratee(value、[context]) |
| 8 | 一意のID _.uniqueId([prefix]) |
| 9 | 逃れる _.escape(string) |
| 10 | エスケープ解除 _.unescape(string) |
| 11 | 結果 _.result(object、property、[defaultValue]) |
| 12 | 今 _.now() |
| 13 | テンプレート _.template(templateString、[設定]) |