- 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]) |
广告