mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Remove semicolons.
This commit is contained in:
14
meanBy.js
14
meanBy.js
@@ -1,7 +1,7 @@
|
||||
import baseSum from './.internal/baseSum.js';
|
||||
import baseSum from './.internal/baseSum.js'
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
const NAN = 0 / 0;
|
||||
const NAN = 0 / 0
|
||||
|
||||
/**
|
||||
* This method is like `mean` except that it accepts `iteratee` which is
|
||||
@@ -15,14 +15,14 @@ const NAN = 0 / 0;
|
||||
* @returns {number} Returns the mean.
|
||||
* @example
|
||||
*
|
||||
* const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
|
||||
* const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]
|
||||
*
|
||||
* meanBy(objects, ({ n }) => n);
|
||||
* meanBy(objects, ({ n }) => n)
|
||||
* // => 5
|
||||
*/
|
||||
function meanBy(array, iteratee) {
|
||||
const length = array == null ? 0 : array.length;
|
||||
return length ? (baseSum(array, iteratee) / length) : NAN;
|
||||
const length = array == null ? 0 : array.length
|
||||
return length ? (baseSum(array, iteratee) / length) : NAN
|
||||
}
|
||||
|
||||
export default meanBy;
|
||||
export default meanBy
|
||||
|
||||
Reference in New Issue
Block a user