mean-component

mean value utility

npm install mean-component
2 downloads in the last week
4 downloads in the last month

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

npm loves you