This approach is reasonable. It comes down to style really. Using Proxies allows you to tap into some meta-programming aspects of JavaScript where you can change the behavior or the syntax slightly. Either way you accomplish this is fine, however Proxies seems like a nicer use case.
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
This is a clever use of Proxy to safely access object properties ✨
What do you think about lodash way to get object properties? It solves the same problem, but in different way.
This approach is reasonable. It comes down to style really. Using Proxies allows you to tap into some meta-programming aspects of JavaScript where you can change the behavior or the syntax slightly. Either way you accomplish this is fine, however Proxies seems like a nicer use case.