Basic usage

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]

Testing

This _.select function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.select on GitHub.