jquery each vs. native for
<pre><code>var arr=[];
var k;
for(var i=0;i&lt;5000;i++)
 arr[i]=i;

console.time("native loop");
var len=arr.length;
for(var j=0;j&lt;len;j++)
 k=arr[j];
console.timeEnd("native loop");

console.time("jq loop");
$(arr).each(function(i,el){
 k=el;
});
console.timeEnd("jq loop");
</code></pre>

<p>It is generating, 14ms for native loop and 3ms for Jquery each.</p>

<p>I'm using Jquery 1.6.2. If Jquery uses native loop behind the scene, then how come, this is possible??</p>
