title: Why am I able to define same function twice in javascript?
body: <p>I have a javascript file in which I write a bunch of jquery functions.  I have a function to return the angular scope. I found out that if I were to write the same function twice, the code still executes. </p>
  
  <pre><code>function getngScope()
  {
      alert(2);
      return angular.element($('#data-area')).scope();
  }
  
  function getngScope()
  {
      alert(1);
      return angular.element($('#data-area')).scope();
  }
  </code></pre>
  
  <p>When I call <code>getngScope()</code> I get "1" alerted and the scope returned. Why does it have this behavior?</p>