title: Javascript : setTimeout use on an anonymous function expression
body: <p>I recently started learning javascript to help maintain some stuff and ran into this issue today:</p>
  
  <pre><code>this.moveChar = function(){  
      // body here
      setTimeout(moveChar,1000);
  }
  
  this.initialise= function(){
      this.moveChar();
  }
  </code></pre>
  
  <p>When initialise is called, I expected moveChar to be called, then repeated call itself once every 1000ms</p>
  
  <p>However, what actually happens is moveChar gets called once then that's it. Based on other stackoverflow posts I read, I suspected it might be something to do with the function being expressed rather than declared. I have tried to use </p>
  
  <pre><code>this.moveChar = function recMove(){  
      // body here
      setTimeout(recMove,1000);
  }
  </code></pre>
  
  <p>without luck either. </p>
  
  <p>Any suggestions on how I can fix this? </p>
  
  <p>EDIT: Main thing I need to do is have the moveChar function called once every second. If there is a better approach than setTimeout recursion, I'm open to it</p>