Array mean utility
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
package.json

Readme.md

mean

mean value utility

Installation

$ component install component/mean

API

mean(array)

Return the mean value in array:

mean([1,5,6,1,2,0])

mean(array, fn)

mean value in array with callback fn(val, i):

var age = mean(users, function(u){ return u.age })

mean(array, string)

mean value in array with the given property string:

var age = mean(users, 'age')

License

MIT