- 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 | flatten
_.flatten(array, [shallow]) |
| 2 | without
_.without(array, *values) |
| 3 | union
_.union(*arrays) |
| 4 | intersection
_.intersection(*arrays) |
| 5 | difference
_.difference(array, *others) |
| 6 | uniq
_.uniq(array, [isSorted], [iteratee]) |
| 7 | zip
_.zip(*arrays) |
| 8 | unzip
_.unzip(array) |
| 9 | object
_.object(list, [values]) |
| 10 | chunk
_.chunk(array, length) |
| 11 | range
_.range([start], stop, [step]) |
廣告