SOURCE

let person = {
  name: "张三"
};

let proxy = new Proxy(person, {
  get(target, property){
    if(property in target){
      return target[property]
    }else {
      throw new Error('你写错啦') 
    }
  }
})

console.log(proxy.name)
console.log(proxy.age)
console 命令行工具 X clear

                    
>
console