Creates a function that selects a specific property value from an object.
Useful for use with arrays map function when extracting a single property from each object.
map
Object target from which the property will be selected
Property name in target that will be selected
The property name to select
select value by key from the target
Use RecordMapper.prop instead.
type Data = {demo: string, value: number | null};const dataArray: Data[] = [{demo: 'hello', value: null}];const output: string[] = dataArray.map(prop(['demo'])); Copy
type Data = {demo: string, value: number | null};const dataArray: Data[] = [{demo: 'hello', value: null}];const output: string[] = dataArray.map(prop(['demo']));
v0.4.2
Creates a function that selects a specific property value from an object.
Useful for use with arrays
mapfunction when extracting a single property from each object.