Urara-Blog/node_modules/.pnpm-store/v3/files/89/78b5fba87b412db8c78e8f7adac56dfe11f264fa1e81337a0b50778ab05a6c504d3fe46dee8eb8299b023e68a1376d377b75600e9494c6ad249158555d8b12
2022-08-14 01:14:53 +08:00

20 lines
568 B
Text

var baseSum = require('./_baseSum');
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/**
* The base implementation of `_.mean` and `_.meanBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the mean.
*/
function baseMean(array, iteratee) {
var length = array == null ? 0 : array.length;
return length ? (baseSum(array, iteratee) / length) : NAN;
}
module.exports = baseMean;