ES5 Reflect

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;
            }
        }
    })

你可能感兴趣的:(ES5 Reflect)