3 ms·
Would JS Proxies be a better comparison? These are similar to get/set, but they let you work dynamically over any given property key: https://developer.mozilla.
by brundolf 5y ago
Would JS Proxies be a better comparison? These are similar to get/set, but they let you work dynamically over any given property key: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
i.e. you could write a single get/set pair that works for every property on an object, intercepting operations and doing arbitrary logic, including passing values on to the default behavior if you want to
- Jtsummers 5y agoI'm not the most proficient JS programmer, but that looks like a more apt comparison, yes.