Basic usage

Given any value and a select function to get the desired attribute, returns the desired value or a default value if the desired value couldn’t be found.

import { get } from 'radash'

const fish = {
  name: 'Bass',
  weight: 8,
  sizes: [{
    maturity: 'adult',
    range: [7, 18],
    unit: 'inches'
  }]
}

const maxAdultSize = get(fish, f => f.sizes[0].range[1])

Testing

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

Source

See the source for _.get on GitHub.