title: Why is the result of two function definitions joined by a comma?
body: <p>Why does the following code alert <code>2</code>?</p>
  
  <pre><code>var f = (function x(){ return 1; }, function y(){ return 2; })();
  alert(f);
  </code></pre>
  
  <p>What I can see is that somehow the <code>y</code> function is getting executed and <code>x</code> function is ignored. (I have made sure that I put <code>alert</code> in both functions, and only the <code>alert</code> in <code>y</code> is called which make me believe that the <code>x</code> function is not being called at all)</p>
  
  <p>And if I remove the <code>y</code> function then it alerts <code>1</code>.</p>
  
  <p>What's going on?</p>