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)