title: Declaring a Javascript variable twice in same scope - Is it an issue?
body: <p>Would the following code cause any issues?:</p>
  
  <pre><code>var a = 1;
  var a = 2;
  </code></pre>
  
  <p>My understanding is that javascript variables are declared at the start of the scope. For example:</p>
  
  <pre><code>var foo = 'a';
  foo = 'b';
  var bar = 'c';
  </code></pre>
  
  <p>Is processed as:</p>
  
  <pre><code>var foo;
  var bar;
  foo = 'a';
  foo = 'b';
  bar = 'c';
  </code></pre>
  
  <p>Therefore would my initial code snippet become:</p>
  
  <pre><code>var a;
  a = 1;
  a = 2;
  </code></pre>
  
  <p>Or would it become:</p>
  
  <pre><code>var a;
  var a;
  a = 1;
  a = 2;
  </code></pre>
  
  <p>I understand that declaring a javascript variable twice in the same scope isn't good practice, but I'm more interested in the impact of doing this.</p>