You are reading a single comment by @ChristianW and its replies. Click here to read the full conversation.
  • 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.

About

Avatar for ChristianW @ChristianW started