You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

409 B

max()

The max method returns the maximum value of a given key:

const collection = collect([
  {
    value: 10,
  },
  {
    value: -13,
  },
  {
    value: 12,
  },
  {
    unicorn: false,
  },
]);

const max = collection.max('value');

// 12
collect([-1, -2345, 12, 11, 3]).max();

// 12

View source on GitHub