iterate over htmlcollection

Benchmark created on


Setup

var nodes = document.getElementsByTagName('span');
    
    function nop() {}

Test runner

Ready to run.

Testing in
TestOps/sec
standard
var i, len = nodes.length;
for (i = 0; i < len; i++) {
    nop(nodes[i]);
}
ready
coercing
var i = 0, node;
while (node = nodes[i++]) {
    nop(node);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.