title: Any way to tell whether a javascript function has returned or not?
body: <p>I'm currently writing some code that wrappers user-written JavaScript functions, and have come across a point in the logic where I would like to trigger a particular behaviour if the function in question never returns a value i.e. the <code>return</code> keyword is never evaluated.</p>
  
  <p>Currently I am assuming that if a function returns <code>undefined</code>, it has not returned, however this is not strictly true&mdash;due to the fact a function can always <code>return undefined</code>, or return the value of an undefined property.</p>
  
  <p>With a function call you can always tell how many parameters were used due to the <code>arguments.length</code> property, I was wondering if anyone knew of a similar trick for a function's return value?</p>
  
  <p>So, is it possible to tell the difference between the return values of <code>a</code>, <code>b</code> or even <code>c</code></p>
  
  <pre><code>var a = function(){  };
  var b = function(){ return undefined; };
  var c = function(){ if(1){}else{return undefined;}; };
  </code></pre>