by TheAceOfHearts · 8y ago · 0 comments
Proxy pays a big performance penalty, and I doubt it'll be improving any time soon. In addition, I believe it's not possible to polyfill Proxy. An alternative could be to just wrap the deep property access in a try/catch:
function getQux (input) {
try {
return input.foo.bar.baz.qux()
} catch (e) {
return null
}
}