OK - found the solution myself. This works:
var Obj = { message: "foo", init: function() { this.message = "foo"; setInterval(()=>{ this.log(); }, 1000); }, log: function() { console.log(this.message); } }; Obj.init();
Something about scope and references I guess.
@ChristianW started
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.
OK - found the solution myself.
This works:
Something about scope and references I guess.