You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • trying this, I would expect an errormessage for incrementing a.
    In Espruino, a is incremented twice, and in log there is 1 3 5 ....21 23
    But by typing console.log(b.a) thje answer is 0, always.
    I'm confused, so is the problem on my side or is it Espruino ?

    function test(){
      var interval;
      this.a = 0;
      interval = setInterval(function(){
          a++;
          this.a++;console.log(a,this.a);
        },2000);
    }
    var b = new test();
    
About

Avatar for JumJum @JumJum started