array like object interator

Benchmark created by xiaoyuze on


Setup

var nodeList = document.querySelectorAll('*');

Test runner

Ready to run.

Testing in
TestOps/sec
for in
for (var i in nodeList) {
  nodeList[i];
}
ready
to array
var arr = Array.prototype.slice.call(nodeList);
for (var i = 0, l = arr.length; i < l; i++) {
  arr[i]
}
ready

Revisions

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

  • Revision 1: published by xiaoyuze on