这种方式应该也可以吧
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Array对象 </title>
<script type="text/javascript">
var time=new Date();
var a=time.getFullYear();
var b=time.getMonth()+1;
var c=time.getDate();
var d=time.getDay();
var f=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
document.write(a+"年"+b+"月"+c+"日"+" "+" "+" "+" "+f[d]+"<br/>");
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var add=scoreStr.split(";")
var sum=0
for(i=0;i<add.length;i++){
sum += parseInt ( add[i].slice(add[0].indexOf(":")+1));
}
document.write(sum/add.length+"<br/>")
</script>
</head>
<body>
</body>
</html>