title: JavaScript variable definition: Commas vs. Semicolons
body: <p>What are the differences and/or advantages, if any, of using commas when declaring a group of variables rather than semicolons.</p>
  
  <p>For example:</p>
  
  <pre><code>var foo = 'bar', bar = 'foo';
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>var foo = 'bar';
  var bar = 'foo';
  </code></pre>
  
  <p>I know that if you specify the <code>var</code> keyword on the first variable in the first example it persists across all of the variables, so they both produce the same end result regarding scope.  Is it just personal preference, or is there a performance benefit to doing it either way?</p>