English 中文(简体)
Underscore.JS - Iterating Collection
  • 时间:2025-02-11

Underscore.JS - Iterating Collections


Previous Page Next Page  

Underscore.JS has many easy to use methods which helps in iterating Collections. This chapter discusses them in detail.

Underscore.JS provides various methods to iterate the Collections as psted below −

Sr.No. Method & Syntax
1 each

_.each(pst, iteratee, [context])

2 map

_.map(pst, iteratee, [context])

3 reduce

_.reduce(pst, iteratee, [memo], [context])

4 reduceRight

_.reduceRight(pst, iteratee, [memo], [context])

5 find

_.find(pst, predicate, [context])

6 filter

_.filter(pst, predicate, [context])

7 where

_.where(pst, properties)

8 findWhere

_.findWhere(pst, properties)

9 reject

_.reject(pst, predicate, [context])

10 every

_.every(pst, [predicate], [context])

11 some

_.some(pst, [predicate], [context])

Advertisements