Underscore.JS - Mapping Objects



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

Underscore.JS provides various methods to handle object mapping as listed below −

Sr.No. Method & Syntax
1 keys

_.keys(object)

2 allKeys

_.allKeys(object)

3 values

_.values(object)

4 mapObject

_.mapObject(object, iteratee, [context])

5 pairs

_.pairs(object)

6 invert

_.invert(object)

7 create

_.create(prototype, props)

8 functions

_.functions(object)

9 findKey

_.findKey(object, predicate, [context])

Advertisements