获取对象的属性

var obj={
get a(){
return Math.random()>=0.5?1:0
}
}
const round=obj.__lookupGetter__("a")
console.log(round)
//拿出 a(){
// return Math.random()>=0.5?1:0
// }

获取对象的属性

const round1=Object.getOwnPropertyDescriptors(obj,"a").get;
console.log(round)
//拿出 a(){
// return Math.random()>=0.5?1:0
// }

获取底层的属性

//底层拿的东西
obj.__defineGetter__("a",function(){
return "get a"
})