function findMaxNum(numbers) {
let max = -Infinity;
for (const n of numbers) {
if (n > max) {
max = n;
}
}
return max;
}
function findMinNum(numbers) {
let min = Infinity;
for (const n of numbers) {
if (n < min) {
min = n;
}
}
return min;
}
标签:function,Infinity,min,max,最小值,查找,numbers,return
From: https://www.cnblogs.com/Enziandom/p/16656581.html