如何把对象转换成数组

2025-05-11 12:37:59
推荐回答(1个)
回答(1):

function transform(obj){
var arr = [];
for(var item in obj){
arr.push(obj[item]);
}
return arr;
}