The object to query.
The path of the property to get.
Optional
defaultValue: anyThe value returned for undefined
resolved values.
Optional
Returns the resolved value.
5.3.0
has, hasIn, set, unset
const object = { 'a': [{ 'b': { 'c': 3 } }] }
get(object, 'a[0].b.c')
// => 3
get(object, ['a', '0', 'b', 'c'])
// => 3
get(object, 'a.b.c', 'default')
// => 'default'
Optional
defaultValue: anyOptional
Gets the value at
path
ofobject
. If the resolved value isundefined
, thedefaultValue
is returned in its place.