const obj = {
name:'zzz',
age:'345'
}
console.log(Reflect.has(obj,'name'));
console.log(Reflect.deleteProperty(obj,'age'));
console.log(Reflect.ownKeys(obj));
let dic = {
"hello": "nihao",
"godd": "hao"
}
dic = new Proxy(dic, {
get(target, phrase) {
if (phrase in target) {
return target[phrase]
} else {
return phrase;
}
}
})
网友评论