let obj = {name:'ESullivan',height:182,weight:150}
方法一:
Object.keys(obj)
方法二:
Object.getOwnPropertyNames(obj)
方法三:
for(var k in obj){
if(obj.hasOwnProperty(k)){
arr.push(k)
}
}
其他方法欢迎大家来补充~
let obj = {name:'ESullivan',height:182,weight:150}
方法一:
Object.keys(obj)
方法二:
Object.getOwnPropertyNames(obj)
方法三:
for(var k in obj){
if(obj.hasOwnProperty(k)){
arr.push(k)
}
}
其他方法欢迎大家来补充~
Comments | NOTHING