var ave;
for(var i=0i<array.lenghti++){
ave+=array[i]
}
ave/=i
return ave
}
alert(getAve([1,2,3,4,5]))
取得数组中的平均值
var arr = [5,8,2,3,7,6,9,1,4,8,3,0]var sum=0
for(var i = 0 i < arr.length i++){
sum += arr[i]
}
var mean = sum / arr.length
console.log(mean)