用indexOf获取分数位置,为什么总是出来undefined
for(var i=0; i<myarr1.length; i++){ //从数组中将成绩撮出来,然后求和取整,并输出 var index=myarr1[i].indexOf(":")+1; document.write(index[i]); var myarr2=parseInt(myarr1[i].substr(index[i],2)); document.write("<br/>"+myarr2[i]); }
for(var i=0; i<myarr1.length; i++){ //从数组中将成绩撮出来,然后求和取整,并输出 var index=myarr1[i].indexOf(":")+1; document.write(index[i]); var myarr2=parseInt(myarr1[i].substr(index[i],2)); document.write("<br/>"+myarr2[i]); }
2016-04-08
举报