题解 | #数组最大值#
数组最大值
http://www.nowcoder.com/practice/7b556cd6c4184e7799199f43f18fa5b1
{"css":"","js":"function _max(array) {
// 补全代码
let max = 0;
array.sort(function (a,b){
return a - b;
}).reverse();
//都可
array.sort(function (a,b){
return b - a;
});
max = array[0];
return max;
}","html":"","libs":[]}