let arr = [34, 67, 98, 200, 567];
function b(a) {
let max = a[0];
for (let i = 1; i < a.length; i++) {
if (max < a[i]) {
max = a[i]
}
return max;
}
}
let max = b(arr);
document.write(max)
最后
以上就是现代台灯最近收集整理的关于JavaScript利用函数求一个数组里的最大值的全部内容,更多相关JavaScript利用函数求一个数组里内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复