slice()是将如“小明:87”单独看成一个数组吗?
var scoreSum =0 ;
var scoreArr = scoreStr.split(";");
for (var i = 0; i < scoreArr.length; i++) {
var getScorePosition =scoreArr[i].indexOf(":")+1;
scoreSum += parseInt(scoreArr[i].slice(getScorePosition));
}
averageScore = Math.floor(scoreSum/scoreArr.length);