📅  最后修改于: 2020-10-19 03:59:59             🧑  作者: Mango
Underscore.JS具有许多易于使用的方法,可帮助处理数组。本章将详细讨论它们。
Underscore.JS提供了多种方法来处理数组,如下所示-
Sr.No. | Method & Syntax |
---|---|
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]) |