title: Javascript multiple comparison expressions syntax
body: <p>By <em>gut-feeling</em> I know the following to be wrong syntax, or at least not working as intended (tried it), but there is no error thrown either:</p>
  
  <pre><code>var x = 2;
  if (1 &lt; x &lt; 3) ...
  </code></pre>
  
  <p>I guess the VM evaluates part of the expression first, then compares it to the rest, but does anybody actually know (with documentation link, preferably) what <strong>exactly</strong> is going on here?</p>
  
  <p><em>Edit: I found a <a href="https://stackoverflow.com/questions/16655959/multiple-comparison-operators-in-a-javascript-boolean-expression?rq=1">similar question</a> that has solutions of how to write this, but I am actually interested in what is happening behind the scenes here.</em></p>