title: Javascript - assign function to variable (reference/value)
body: <p>I am trying to change the definition of a function:</p>
  
  <pre><code>var a = function(){alert('a');};
  var b = a;
  b = function(){alert('b');};
  </code></pre>
  
  <p>This results in the variable <code>a</code> keeping it's original assignment i.e. the function producing <code>alert('a')</code>.</p>
  
  <p>Is there any way of passing around a reference to a javascript function so that I can alter it later?</p>