http://jsperf.com/jquery-each-vs-for-loop/108
for (var b = a[0], len = a.length; len; b = a[--len]) {
newArray.push(
b
);
}
and
for (var i = 0, len = a.length; i < len; i++) {
newArray.push(
a[i]
);
}
- According to jsref, it says the first one is faster. why?
- Can anyone explain me the for loop on whats its doing compared to traditional way?