EdwardZZZ / articles

工作点滴记录
2 stars 0 forks source link

Symbol #55

Closed EdwardZZZ closed 4 years ago

EdwardZZZ commented 5 years ago
const p = new Proxy({}, {
    get(_, key) {
        console.log(key);
    }
})
console.log(key);
class Test {
    test() {
        console.log('1');
    }

    [Symbol.for('test')]() {
        console.log('this is test.');
    }
}

console.log(Reflect.ownKeys(Test.prototype));
console.log(Object.getOwnPropertyNames(Test.prototype));