js对象转数组

let obj =  {name:'Mary',num:10,age:18 };

let arr = [];

for(let i in obj){

    arr.push(obj[i])

}

console.log(arr)

你可能感兴趣的:(js对象转数组)