Lodash – Collection

  • Post author:
  • Post category:Lodash
  • Post comments:0 Comments
Lodash - Collection

Lodash Collection has many easy-to-use methods which help in processing Collections. This chapter discusses them in detail.

Lodash provides various methods to process the Collections as listed below −

Sr.No.Method & Syntax
1countBy_.countBy(collection, [iteratee=_.identity])
2every_.every(collection, [predicate=_.identity])
3filter_.filter(collection, [predicate=_.identity])
4find_.find(collection, [predicate=_.identity], [fromIndex=0])
5findLast_.findLast(collection, [predicate=_.identity], [fromIndex=collection.length-1])
6flatMap_.flatMap(collection, [iteratee=_.identity])
7flatMapDeep_.flatMapDeep(collection, [iteratee=_.identity])
8flatMapDepth_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])
9forEach_.forEach(collection, [iteratee=_.identity])
10forEachRight_.forEachRight(collection, [iteratee=_.identity])
11groupBy_.groupBy(collection, [iteratee=_.identity])
12includes_.includes(collection, value, [fromIndex=0])
13invokeMap_.invokeMap(collection, path, [args])
14keyBy_.keyBy(collection, [iteratee=_.identity])
15map_.map(collection, [iteratee=_.identity])
16orderBy_.orderBy(collection, [iteratees=[_.identity]], [orders])
17partition_.partition(collection, [predicate=_.identity])
18reduce_.reduce(collection, [iteratee=_.identity], [accumulator])
19reduceRight_.reduceRight(collection, [iteratee=_.identity], [accumulator])
20reject_.reject(collection, [predicate=_.identity])
21sample_.sample(collection)
22sampleSize_.sampleSize(collection, [n=1])
23shuffle_.shuffle(collection)
24size_.size(collection)
25some_.some(collection, [predicate=_.identity])
26sortBy_.sortBy(collection, [iteratees=[_.identity]])

Next Topic – Click Here

Leave a Reply