mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
20 lines
355 B
JavaScript
20 lines
355 B
JavaScript
import baseMean from './meanBy.js'
|
|
|
|
/**
|
|
* Computes the mean of the values in `array`.
|
|
*
|
|
* @since 4.0.0
|
|
* @category Math
|
|
* @param {Array} array The array to iterate over.
|
|
* @returns {number} Returns the mean.
|
|
* @example
|
|
*
|
|
* mean([4, 2, 8, 6])
|
|
* // => 5
|
|
*/
|
|
function mean(array) {
|
|
return baseMean(array, (value) => value)
|
|
}
|
|
|
|
export default mean
|