title: Trigger one prototype function from another (including itself)
body: <h2>The Problem</h2>
  
  <p>I have created a constructor called <code>Game</code>. Then, I tried to expand it's functionality by adding two new functions (<code>update</code> and <code>render</code>) using prototype. </p>
  
  <p>However, I'd like my <code>update</code> function to be able to call both <strong>itself</strong> and then call <code>render</code>. </p>
  
  <h2>My Code</h2>
  
  <pre><code>var Game = function(){
  
  };
  
  Game.prototype.update = function(){
      requestAnimationFrame(this.render);
      requestAnimationFrame(this.update);
  };
  Game.prototype.render = function(){
    console.log('Rendering');
  };
  
  var game = new Game();
  game.update();
  </code></pre>
  
  <h2>What I have also Tried</h2>
  
  <pre><code>requestAnimationFrame(render);
  requestAnimationFrame(update);
  </code></pre>
  
  <p>And..</p>
  
  <pre><code>requestAnimationFrame(Game.render);
  requestAnimationFrame(Game.update);
  </code></pre>
  
  <p>And...</p>
  
  <pre><code>requestAnimationFrame(Parent.render);
  requestAnimationFrame(Parent.update);
  </code></pre>
  
  <p>But due to some (<strong>glaringly obvious</strong>) gaps in my javascript knowledge, I can't make this work. It appears as if <code>this</code> and <code>parent</code> are both referring to <code>window</code> - I'm guessing that's because of how the functions were created. </p>
  
  <p>This is the error I receive;</p>
  
  <blockquote>
    <p>Game.js:6 Uncaught TypeError: Failed to execute
    'requestAnimationFrame' on 'Window': The callback provided as
    parameter 1 is not a function.</p>
  </blockquote>
  
  <h2>Questions I've already found</h2>
  
  <p>I've already found the following questions on SO, but they don't appear to be all that helpful to this particular problem.</p>
  
  <p><a href="https://stackoverflow.com/questions/22143926/javascript-multiple-prototype-functions-how-to-call-one-from-another">Javascript multiple prototype functions - how to call one from another</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17938323/calling-function-from-prototype-function">calling function from prototype function</a></p>