It turns out, JavaScript provides a method of "trapping" nearly any operation on an object - property access, assignment, enumeration, and even property deletion. How? Via a Proxy. Think of a Proxy as a "hook" or "middleware" that can be used to gaslight the caller into seeing the proxied object any way you want them to see it. When you wrap an object in a Proxy, you can do almost anything you imagine - hide properties like I did with goodbye above, invent new "virtual" properties, or even make operations on properties "cursed":

no comments (yet)

sorted by: hot top controversial new old
there doesn't seem to be anything here