Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / mean.js
1 var sum = require('./sum');
2
3 /**
4  * Computes the mean of the values in `array`.
5  *
6  * @static
7  * @memberOf _
8  * @category Math
9  * @param {Array} array The array to iterate over.
10  * @returns {number} Returns the mean.
11  * @example
12  *
13  * _.mean([4, 2, 8, 6]);
14  * // => 5
15  */
16 function mean(array) {
17   return sum(array) / (array ? array.length : 0);
18 }
19
20 module.exports = mean;