Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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')

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