Basic usage

Given an array of items return the final item that wins the comparison condition. Useful for more complicated min/max.

import { boil } from 'radash'

const gods = [{
  name: 'Ra',
  power: 100
}, {
  name: 'Zeus',
  power: 98
}, {
  name: 'Loki',
  power: 72
}]

const mostPowerful = boil(gods, (a, b) => a.power > b.power ? a : b) // => { name: 'Ra', power: 100 }

Testing

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

Source

See the source for _.boil on GitHub.