Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (17 sloc)
355 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import baseMean from './meanBy.js' | |
/** | |
* Computes the mean of the values in `array`. | |
* | |
* @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, (value) => value) | |
} | |
export default mean |