js数组对象之间的转换


let smoke = resdata.data
for (var i in smoke) {
let o = {}
o.key = smoke[i].id
o.label = smoke[i].name
that.smokedata.push(o)
}

o.name = fileListdata[i].fileName
that.fileListwenjian.push(o)
that.filestr=fileListdata[i].id
}

数组转字符串去掉最后逗号
var picid = ''
let pic_List = this.picList
for (let i in pic_List) {
picid += pic_List[i].value + ','
}
if (picid.length > 0) {
picid = picid.substr(0, picid.length - 1)
}

【js数组对象之间的转换】


    推荐阅读