blob: e3ffff67c79b05dcd1d339b62679c0472163ba99 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var baseMean = require('./_baseMean'),
2 identity = require('./identity');
3
4/**
5 * Computes the mean of the values in `array`.
6 *
7 * @static
8 * @memberOf _
9 * @since 4.0.0
10 * @category Math
11 * @param {Array} array The array to iterate over.
12 * @returns {number} Returns the mean.
13 * @example
14 *
15 * _.mean([4, 2, 8, 6]);
16 * // => 5
17 */
18function mean(array) {
19 return baseMean(array, identity);
20}
21
22module.exports = mean;