JavaScript如何计算数组中的元素平均值var arr = [5,8,2,3,7,6,9,1,4,8,3,0]var sum=0for(var i = 0 i < arr.length i++){ sum += arr[i]}var mean = sum 2023-04-20JavaScript180