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.
How can I write a JavaScript module that can be installed on the Bangle and then required from another app? Is that possible?
Search Options
Types to Display
Espruino
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.