|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
568 bytes
|
| Line | |
|---|
| 1 | var baseSum = require('./_baseSum');
|
|---|
| 2 |
|
|---|
| 3 | /** Used as references for various `Number` constants. */
|
|---|
| 4 | var NAN = 0 / 0;
|
|---|
| 5 |
|
|---|
| 6 | /**
|
|---|
| 7 | * The base implementation of `_.mean` and `_.meanBy` without support for
|
|---|
| 8 | * iteratee shorthands.
|
|---|
| 9 | *
|
|---|
| 10 | * @private
|
|---|
| 11 | * @param {Array} array The array to iterate over.
|
|---|
| 12 | * @param {Function} iteratee The function invoked per iteration.
|
|---|
| 13 | * @returns {number} Returns the mean.
|
|---|
| 14 | */
|
|---|
| 15 | function baseMean(array, iteratee) {
|
|---|
| 16 | var length = array == null ? 0 : array.length;
|
|---|
| 17 | return length ? (baseSum(array, iteratee) / length) : NAN;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | module.exports = baseMean;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.