Skip to content

mean

js
_.mean(array)

计算 array 中值的平均值。

¥Computes the mean of the values in array.

新增于

¥Since

4.0.0

参数

¥Arguments

  1. array (数组):要迭代的数组。

    ¥array (Array): The array to iterate over.

返回

¥Returns

(数值):返回平均值。

¥(number): Returns the mean.

示例

¥Example

js
_.mean([4, 2, 8, 6]);
// => 5

Lodash v4.17 中文网 - 粤ICP备13048890号