mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Bump to v4.7.0.
This commit is contained in:
6
mean.js
6
mean.js
@@ -1,10 +1,12 @@
|
||||
import sum from './sum';
|
||||
import baseMean from './_baseMean';
|
||||
import identity from './identity';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -14,7 +16,7 @@ import sum from './sum';
|
||||
* // => 5
|
||||
*/
|
||||
function mean(array) {
|
||||
return sum(array) / (array ? array.length : 0);
|
||||
return baseMean(array, identity);
|
||||
}
|
||||
|
||||
export default mean;
|
||||
|
||||
Reference in New Issue
Block a user