Underscore.JS - Updating Objects



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

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

Sr.No. Method & Syntax
1 extend

_.extend(destination, *sources)

2 pick

_.pick(object, *keys)

3 omit

_.omit(object, *keys)

4 defaults

_.defaults(object, *defaults)

5 clone

_.clone(object)

6 tap

_.tap(object, interceptor)

7 has

_.has(object, key)

8 property

_.property(path)

9 propertyOf

_.propertyOf(object)

Advertisements