使用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);