var streamerStatus = [];
var streamers = ['x', 'y', 'z'];
for (var i = 0; i < streamers.length; i++){
streamerStatus.push({streamers[i]: 'OFFLINE'});
}
答案 0 :(得分:0)
for (var i = 0; i < streamers.length; i++){
var obj = {};
obj[streamers[i]] = 'OFFLINE';
streamerStatus.push(obj);
}