Basic usage

Given an array of items and a function to get the value of each item, returns the item with the largest value. Uses _.boil under the hood.

import { max } from 'radash'

const fish = [{
  name: 'Marlin',
  weight: 105,
  source: 'ocean'
}, {
  name: 'Bass',
  weight: 8,
  source: 'lake'
}, {
  name: 'Trout',
  weight: 13,
  source: 'lake'

max(fish, f => f.weight) // => {name: "Marlin", weight: 105, source: "ocean"}


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


See the source for _.max on GitHub.