Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/max
max value in array -- max(users, 'age')
https://github.com/component/max
Last synced: 13 days ago
JSON representation
max value in array -- max(users, 'age')
- Host: GitHub
- URL: https://github.com/component/max
- Owner: component
- Created: 2012-11-03T07:21:44.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-09T23:41:41.000Z (about 11 years ago)
- Last Synced: 2024-05-08T17:07:05.711Z (8 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 2
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# max
Max value utility
## Installation
$ component install component/max
## API
### max(array)
Return the max value in `array`:
```js
max([1,5,6,1,2,0])
```### max(array, fn)
Max value in `array` with callback `fn(val, i)`:
```js
var age = max(users, function(u){ return u.age })
```### max(array, string)
Max value in `array` with the given property `string`:
```js
var age = max(users, 'age')
```# License
MIT