title: Why are my JavaScript function names clashing?
body: <p>I wrote the following script just to see what happens when a variable and a function that has a function assigned to it have their names clash:</p>
  
  <pre><code>var f = function() {
      console.log("Me original.");
  }
  
  function f() {
      console.log("Me duplicate.");
  }
  
  f();
  </code></pre>
  
  <p>The output I'm getting is "Me original." Why was the other function not called?</p>
  
  <p>Also, if I change my original assignment to <code>var f = new function() {</code>, I get "Me original", followed by a TypeError saying <code>object is not a function</code>. Can someone please explain?</p>