core3-utils

@wixc3/common on Github

Home > @wixc3/common > getIn

getIn() function

Signature:

export declare function getIn(obj: Record<string, any>, path: string[]): unknown;

Parameters

Parameter Type Description
obj Record<string, any> The object to query
path string\[\] The path of the property to get.

Returns:

unknown

The value at path of object id exists, undefined otherwise

Example

getIn({ a: { b: 'c' } }, ['a', 'b']) // => c