Lodash - Object


Advertisements

Lodash has many easy to use Object related methods. This chapter discusses them in detail.

Lodash provides various Object related methods as listed below −

Sr.No. Method & Syntax
1

assign

_.assign(object, [sources])

2

assignIn

_.assignIn(object, [sources])

3

assignInWith

_.assignInWith(object, sources, [customizer])

4

assignWith

_.assignWith(object, sources, [customizer])

5

at

_.at(object, [paths])

6

create

_.create(prototype, [properties])

7

defaults

_.defaults(object, [sources])

8

defaultsDeep

_.defaultsDeep(object, [sources])

9

findKey

_.findKey(object, [predicate=_.identity])

10

findLastKey

_.findLastKey(object, [predicate=_.identity])

11

forIn

_.forIn(object, [iteratee=_.identity])

12

forInRight

_.forInRight(object, [iteratee=_.identity])

13

forOwn

_.forOwn(object, [iteratee=_.identity])

14

forOwnRight

_.forOwnRight(object, [iteratee=_.identity])

15

functions

_.functions(object)

16

functionsIn

_.functionsIn(object)

17

get

_.get(object, path, [defaultValue])

18

has

_.has(object, path)

19

hasIn

_.hasIn(object, path)

20

invert

_.invert(object)

21

invertBy

_.invertBy(object, [iteratee=_.identity])

22

invoke

_.invoke(object, path, [args])

23

keys

_.keys(object)

24

keysIn

_.keysIn(object)

25

mapKeys

_.mapKeys(object, [iteratee=_.identity])

26

mapValues

_.mapValues(object, [iteratee=_.identity])

27

merge

_.merge(object, [sources])

28

mergeWith

_.mergeWith(object, sources, customizer)

29

omit

_.omit(object, [paths])

30

omitBy

_.omitBy(object, [predicate=_.identity])

31

pick

_.pick(object, [paths])

32

pickBy

_.pickBy(object, [predicate=_.identity])

33

result

_.result(object, path, [defaultValue])

34

set

_.set(object, path, value)

35

setWith

_.setWith(object, path, value, [customizer])

36

toPairs

_.toPairs(object)

37

toPairsIn

_.toPairsIn(object)

38

transform

_.transform(object, [iteratee=_.identity], [accumulator])

39

unset

_.unset(object, path)

40

update

_.update(object, path, updater)

41

updateWith

_.updateWith(object, path, updater, [customizer])

42

values

_.values(object)

43

valuesIn

_.valuesIn(object)

Advertisements