Array
Filter and map an array
Applies a filter and a map operation at once and in one pass.
import { select } from 'radash'
const fish = [
{
name: 'Marlin',
weight: 105,
source: 'ocean'
},
{
name: 'Bass',
weight: 8,
source: 'lake'
},
{
name: 'Trout',
weight: 13,
source: 'lake'
}
]
select(
fish,
f => f.weight,
f => f.source === 'lake'
) // => [8, 13]