_.max(取数组中最大值)
语法:
_.max(array)
源代码链接:source
npm包链接:npm package
描述:
计算array
中的最大值。 如果array
是 空的或者假值将会返回undefined
。
开始版本:0.1.0
参数:
array (Array)
: 要迭代的数组。
返回值:
(*)
: 返回最大的值。
例子:
_.max([4, 2, 8, 6]);
// => 8
_.max([]);
// => undefined
Last updated
Was this helpful?