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.

snitko
  • 9,551
  • 11
  • 62
  • 90

0 Answers0