You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
420 B
23 lines
420 B
2 weeks ago
|
import baseMean from './_baseMean.js';
|
||
|
import identity from './identity.js';
|
||
|
|
||
|
/**
|
||
|
* Computes the mean of the values in `array`.
|
||
|
*
|
||
|
* @static
|
||
|
* @memberOf _
|
||
|
* @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, identity);
|
||
|
}
|
||
|
|
||
|
export default mean;
|