Proxy II
2022年5月1日小于 1 分钟
Proxy II
Question
What does the code snippet to the right output by console.log
?
Snippet
class Dev {
#name
constructor(name) {
this.#name = name
}
get name() {
return this.#name;
}
}
const dev = new Dev('BFE')
console.log(dev.name)
const proxyDev = new Proxy(dev, {})
console.log(proxyDev.name)