let obj = res.data.data.age;
var arr = [];
var arr1 = [];
for (let i in obj) {
arr.push(obj[i]); //属性
arr1.push(i); //key
}
console.log(arr);
console.log(arr1);
本文参考链接:https://www.cnblogs.com/wulicute-TS/p/13372695.html