<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>数组</title>
</head>
<body>
<script>
var arr=[1,2,"炸弹",3,4,"炸弹",5];
// 补充代码
var sum = 0 ;
for(var i = 0;i<arr.length;i++){
if(arr[i]!="炸弹"){
sum+=arr[i]
}
}
document.write(sum)
</script>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星