1

I know it's possible in Javascript to have an object run a certain code when a non-existing method is called (with Proxies). But is it possible to do the same for non-existing properties?

That is, I'd like to say

object.field1 = true
console.log(object.field1)

And on both getter and setter calls have my own code run instead of values being assigned and retrieved.

orion3
  • 9,797
  • 14
  • 67
  • 93

0 Answers0