-
• #2
There is a way, yes - you can use getters and setters :) Just use
Object.defineProperty
to create the variable, then add the getter and setter functions that you want... http://www.espruino.com/Reference#l_Object_defineProperty
There is a way, yes - you can use getters and setters :) Just use Object.defineProperty
to create the variable, then add the getter and setter functions that you want... http://www.espruino.com/Reference#l_Object_defineProperty
Is there a way to have something like setWatch on a variable?
AFAIK, its working for Pins only.
Options comin to my mind are: