如何把下面forEach循环改成for循环:v.cityData.forEach(function(e){letname=e.name.substr(0,1);letlen=e.cities.length;v.anchorMap[name]=y;y-=titleHeight+len*itemHeight;});
2 回答

偶然的你
TA贡献1841条经验 获得超3个赞
for(leti=0;ilete=v.cityData[i] letname=e.name.substr(0,1);letlen=e.cities.length;v.anchorMap[name]=y;y-=titleHeight+len*itemHeight;}回答完这个问题之后有种难以言表的心情。。。

四季花海
TA贡献1811条经验 获得超5个赞
for(leti=0,iLen=v.cityData.length;ilete=v.cityData[i]; letname=e.name.substr(0,1);letlen=e.cities.length;v.anchorMap[name]=y;y-=titleHeight+len*itemHeight;}
添加回答
举报
0/150
提交
取消