- Lodash Tutorial
- Lodash - Home
- Lodash - Overview
- Lodash - Environment Setup
- Lodash - Array
- Lodash - Collection
- Lodash - Date
- Lodash - Function
- Lodash - Lang
- Lodash - Math
- Lodash - Number
- Lodash - Object
- Lodash - Seq
- Lodash - String
- Lodash - Util
- Lodash - Properties
- Lodash - Methods
- Lodash Useful Resources
- Lodash - Quick Guide
- Lodash - Useful Resources
- Lodash - Discussion
Lodash - 收藏
Lodash 有许多易于使用的方法,有助于处理集合。本章详细讨论它们。
Lodash 提供了各种方法来处理集合,如下所示 -
| 先生。 | 方法和语法 |
|---|---|
| 1 |
_.countBy(集合, [iteratee=_.identity]) |
| 2 |
_.every(集合, [谓词=_.identity]) |
| 3 |
_.filter(集合, [谓词=_.identity]) |
| 4 |
_.find(集合, [谓词=_.identity], [fromIndex=0]) |
| 5 |
_.findLast(集合, [谓词=_.identity], [fromIndex=collection.length-1]) |
| 6 |
_.flatMap(集合, [iteratee=_.identity]) |
| 7 |
_.flatMapDeep(集合, [iteratee=_.identity]) |
| 8 |
_.flatMapDepth(集合, [iteratee=_.identity], [深度=1]) |
| 9 |
_.forEach(集合, [iteratee=_.identity]) |
| 10 |
_.forEachRight(集合, [iteratee=_.identity]) |
| 11 |
_.groupBy(集合, [iteratee=_.identity]) |
| 12 |
_.includes(集合, 值, [fromIndex=0]) |
| 13 |
_.invokeMap(集合、路径、[args]) |
| 14 |
_.keyBy(集合, [iteratee=_.identity]) |
| 15 |
_.map(集合, [iteratee=_.identity]) |
| 16 |
_.orderBy(集合, [iteratees=[_.identity]], [订单]) |
| 17 号 |
_.partition(集合, [谓词=_.identity]) |
| 18 |
_.reduce(集合, [iteratee=_.identity], [累加器]) |
| 19 |
_.reduceRight(集合, [iteratee=_.identity], [累加器]) |
| 20 |
_.reject(集合, [谓词=_.identity]) |
| 21 |
_。样品采集) |
| 22 |
_.sampleSize(集合,[n=1]) |
| 23 |
_.shuffle(集合) |
| 24 |
_.size(集合) |
| 25 |
_.some(集合, [谓词=_.identity]) |
| 26 |
_.sortBy(集合, [iteratees=[_.identity]]) |