使用map函數
var array=[ { id:1, classid:255, name:'一年級' }, { id:2, classid:256, name:'二年級' }, { id:3, classid:257, name:'三年級' }, ] array = array.map(v => { return v.classid + '_' + v.id + '_' + v.classname + '_' + v.book; }); let arrs = array.join(','); console.log(arrs);
