第一种方法: 循环数组 let ary = [1,2,22,3,99,100],maxNum = ary[0] function getMaxNum(ary){ for(let i = 1,len = ary.length;i<len;i++){ maxNum > ary[i]?null:maxNum = ary[i]; } return maxNum } console.log(getMaxNum(ary)) 第二种方法:用eval+Math.max let ary = [1,2,22,3,…