Files
ihrm/node_modules/collect.js/docs/api/max.md
Nikhil Ravi Cybrosys e1794e7422 [UPDT]translations in the views (#4)
[UPDT]Translations in the views
[FIX]major bug fixes
2023-05-18 15:05:28 +05:30

32 lines
440 B
Markdown
Executable File

# `max()`
The max method returns the maximum value of a given key:
```js
const collection = collect([
{
value: 10,
},
{
value: -13,
},
{
value: 12,
},
{
unicorn: false,
},
]);
const max = collection.max('value');
// 12
```
```js
collect([-1, -2345, 12, 11, 3]).max();
// 12
```
[View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/max.js)