数组中最大偶数
let arr = [11, 45, 87, 10, 99, 5, 22, 7, 77, 88, 100, 13]; let arr1 = [] let max = 0; for (let i = 0; i < arr.length; i++) { // arr的每一个数组除以2余数是0 if (arr[i] % 2 == 0) { arr1.push(arr[i]) } } for (let j = 0; j < arr1.length; j++) { if (arr1[j] > max) { max = arr1[j] } } document.write('最大值' + max);