Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/component/variance

Array variance utility
https://github.com/component/variance

Last synced: 13 days ago
JSON representation

Array variance utility

Awesome Lists containing this project

README

        

# variance

variance utility

## Installation

$ component install component/variance

## API

### variance(array)

Return the variance of `array`:

```js
variance([1,5,6,1,2,0])
```

### variance(array, fn)

variance of `array` with callback `fn(val, i)`:

```js
var age = variance(users, function(u){ return u.age })
```

### variance(array, string)

variance of `array` with the given property `string`:

```js
var age = variance(users, 'age')
```

# License

MIT