Function prop

Returns the specified property of an object.

prop('name')({ name: 'John', surname: 'Doe' }) // 'John'
prop('age')({ name: 'John', surname: 'Doe' } as Record<string, string>) // undefined