一、for循环的使用
①for(let i = 0 ; i length ; ++i){ }
示例:

for(let i=0;ilength;++i){     console.log(temp[i]) }

②for(var x in temp){ }
示例:

for (var x in temp) {//x = index    that.data.imgs.push({ path: temp[tm],label:'添加标签'});}

二、array数组属性及方法 参照链接:http://www.w3school.com.cn/jsref/jsref_obj_array.asp

数组修改;
this.data.imgs[0].path=”//a/b”

TAG标签: 微信小程序for循环遍历数组

http://www.xiaochengxub.com/read-105567.html