Lodash max method
语法
Computes the maximum value of array. If array is empty or falsey, undefined is returned.
参数
array (Array) − The array to iterate over.
输出
(*) − Returns the maximum value.
实例
var _ = require('lodash');
console.log(_.max([ 4, 6, 1, 5]));
Save the above program in
tester.js. Run the following command to execute this program.
Command
输出