title: Why does javascript accept commas in if statements?
body: <p>I stumbled across some javascript syntax that seemed like it should produce a parse error of some kind but doesn't: </p>
  
  <pre><code>if (true, true) {console.log('splendid')} else {console.log('horrid')} // splendid
  if (true, false) {console.log('splendid')} else {console.log('horrid')} // horrid
  </code></pre>
  
  <p>It seems only the last expression affects the logic, though all expressions are executed:</p>
  
  <pre><code>if  (console.log('super'), true) {console.log('splendid')} // super splendid
  </code></pre>
  
  <p>Anyone know why that is valid javascript syntax? Is there any practical use for it?</p>