- Underscore.JS Tutorial
- Underscore.JS - Home
- Underscore.JS - Overview
- Underscore.JS - Environment Setup
- Underscore.JS - Iterating Collection
- Underscore.JS - Processing Collection
- Underscore.JS - Iterating Array
- Underscore.JS - Processing Array
- Underscore.JS - Functions
- Underscore.JS - Mapping Objects
- Underscore.JS - Updating Objects
- Underscore.JS - Comparing Objects
- Underscore.JS - Utilities
- Underscore.JS - Chaining
- Underscore.JS Useful Resources
- Underscore.JS - Quick Guide
- Underscore.JS - Useful Resources
- Underscore.JS - Discussion
Underscore.JS - Iterating Collections
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 listed below −
Sr.No. | Method & Syntax |
---|---|
1 | each
_.each(list, iteratee, [context]) |
2 | map
_.map(list, iteratee, [context]) |
3 | reduce
_.reduce(list, iteratee, [memo], [context]) |
4 | reduceRight
_.reduceRight(list, iteratee, [memo], [context]) |
5 | find
_.find(list, predicate, [context]) |
6 | filter
_.filter(list, predicate, [context]) |
7 | where
_.where(list, properties) |
8 | findWhere
_.findWhere(list, properties) |
9 | reject
_.reject(list, predicate, [context]) |
10 | every
_.every(list, [predicate], [context]) |
11 | some
_.some(list, [predicate], [context]) |
Advertisements