- Underscore.JS 教程
- Underscore.JS - 主頁
- Underscore.JS - 概覽
- Underscore.JS - 環境設定
- Underscore.JS - 迭代集合
- Underscore.JS - 處理集合
- Underscore.JS - 迭代陣列
- Underscore.JS - 處理陣列
- Underscore.JS - 函式
- Underscore.JS - 對映物件
- Underscore.JS - 更新物件
- Underscore.JS - 比較物件
- Underscore.JS - 實用工具
- Underscore.JS - 鏈式呼叫
- Underscore.JS 有用資源
- Underscore.JS - 快速指南
- Underscore.JS - 有用資源
- Underscore.JS - 討論
Underscore.JS - 實用工具
Underscore.JS 有許多易於使用的實用工具方法。本章將詳細介紹它們。
Underscore.JS 提供以下各種實用程式方法 -
| 序號 | 方法和語法 |
|---|---|
| 1 | 恆等性
_.identity(value) |
| 2 | 常量
_.constant(value) |
| 3 | 空
_.noop() |
| 4 | 次
_.times(n, iteratee, [context]) |
| 5 | 隨機
_.random(min, max) |
| 6 | 混合
_.mixin(object) |
| 7 | 迭代
_.iteratee(value, [context]) |
| 8 | 唯一識別符號
_.uniqueId([prefix]) |
| 9 | 轉義
_.escape(string) |
| 10 | 取消轉義
_.unescape(string) |
| 11 | 結果
_.result(object, property, [defaultValue]) |
| 12 | 現在
_.now() |
| 13 | 模板
_.template(templateString, [settings]) |
廣告