Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/variance
Array variance utility
https://github.com/component/variance
Last synced: 13 days ago
JSON representation
Array variance utility
- Host: GitHub
- URL: https://github.com/component/variance
- Owner: component
- Created: 2013-01-12T02:14:26.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-08-21T17:31:02.000Z (over 11 years ago)
- Last Synced: 2024-05-08T17:06:10.315Z (8 months ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 3
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
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