Skip to main content

prop()

prop<T>(obj): <K>(prop) => T[K]

Gets the value of prop in obj. Array index support.

Type Parameters

T extends object

The type of the input object.

Parameters

obj

T

The object to get the value from.

Returns

Function

Type Parameters

K extends string | number | symbol

Parameters

prop

K

Returns

T[K]

Remarks

pure function

Remarks

pure function

Example

property(personStore)('address');
// personStore.address

property(userStore.profile)(0);
// userStore.profile.at(0)