Learning how JavaScript optimizes execution, if at all
<p>Is there a way to learn at how JavaScript is interpreted and executed? In .NET or JAVA for instance, you could look at the generated byte code, in C you could look at the generated assembly instruction but from what I gather, JavaScript is interpreted line by line and then it varies on the JS engine in different browsers.</p>

<p>Still is there a way to learn how JavaScript does this? Does the interpreter in modern browsers tend to look ahead and optimize as a compiler might?</p>

<p>For instance, if I did:</p>

<pre><code>$('#div1').css('background-color','red');
$('#div1').css('color','white');
</code></pre>

<p>Could I have a perf gain by doing:</p>

<pre><code>var x = $('#div1');
x.css('background-color','red');
x.css('color','white');
</code></pre>

<p>The point of this question is to get some information how one might gain some insight as to how JavaScript is run in the browser.</p>
