let obj = {
test1: "aa",
test2: "bb",
test3: "cc",
test4: "dd",
test5: "ff",
test6: "ee"
};
转换为:
let arr = [];
for (let key in obj) {
let newobj = {};
newobj[key] = obj[key];
arr.push(newobj);
}
console.log( arr);