title: JavaScript Function Context Incorrect
body: <p>I noticed a weird thing in javascript. Consider the below:</p>
  
  <pre><code>var fn = ''.toUpperCase.call
  console.log(typeof fn); // "function"
  fn(); // Uncaught TypeError: `fn` is not a function
  </code></pre>
  
  <p>The above was executed on my Chrome's Developer Console. Version is <code>43.0.2357.81 m</code>.</p>
  
  <p>The <code>typeof</code> operator clearly shows that <code>fn</code> is a function, but the error suggests otherwise.</p>
  
  <p>I've noticed that <code>Function.apply</code> shows at least some meaningful error message.</p>
  
  <p>So, when is a function, not a function?</p>