Given a path in form of a string, returns a function that extracts the value at that path from an object.
const obj = { a: { b: { c: 1 } } } as const;const a = path('a.b.c')(obj); // 1const b = path('a.s')(obj); // undefined Copy
const obj = { a: { b: { c: 1 } } } as const;const a = path('a.b.c')(obj); // 1const b = path('a.s')(obj); // undefined
Given a path in form of a string, returns a function that extracts the value at that path from an object.
Example