Is order of evaluation sequential in Javascript?
<p>At a job interview, I was perplexed to hear "javascript can evaluate statements out of order." To what degree is this true? I can imagine a hundred ways to explicitly evaluate statements out of order -- such as in a time-sharing operating system. But he <em>seemed</em> to say that if I evaluate</p>

<pre><code>console.log('a')
console.log('b')
</code></pre>

<p>that the Javascript spec somehow doesn't require that the output would be <code>a</code> first then <code>b</code>. I can imagine that the evaluator might <em>try</em> to evaluate the second statement if the IO of the first is blocking if the statements are functionally pure, i.e. no side effects, but side effects must always occur in sequence, correct? And of course IO is one big side effect.</p>

<p>To what extent can spec-compliant Javascript evaluate out of order? Or was this a case of miscommunication?</p>
