Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 458 Bytes

Readme.md

File metadata and controls

38 lines (22 loc) · 458 Bytes

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