In general I try to stay away from using this altogether. If you have to use it, use apply or bind. Another trick that works in some cases is to reassign it to a variable that will be available to your scope.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
In general I try to stay away from using
this
altogether. If you have to use it, useapply
orbind
. Another trick that works in some cases is to reassign it to a variable that will be available to your scope.