title: Javascript ternary operator and assignment
body: <p>I get unexpected result for this simple JavaScript assignment statement:</p>
  
  <pre><code>var t = 1 == 1 ? 1 : 0;
  undefined
  </code></pre>
  
  <p>I would have expected to get 1 assigned to t instead. Same result if you do</p>
  
  <pre><code>var t = (1 == 1 ? 1 : 0);
  undefined
  </code></pre>
  
  <p>Can somebody explain why this does not work as expected?</p>