01
02
03
04
05
06
07
08
09
10
{"ScriptPreparationCode":"var list=document.querySelector(\u0027#list\u0027);\r\nfunction createCopy(el) {\r\n var l = [];\r\n for (var node = list.firstChild; node; node = node.nextSibling) {\r\n l.push(node);\r\n }\r\n return l;\r\n}","TestCases":[{"Name":"Just loop","Code":"var node, count = 0;\r\nfor (node = list.firstChild; node; node = node.nextSibling) {\r\n count\u002B\u002B;\r\n}\r\nfor (node = list.firstChild; node; node = node.nextSibling) {\r\n count\u002B\u002B;\r\n}","IsDeferred":false},{"Name":"Create copy and loop","Code":"var node, count = 0, l = createCopy(list), i;\r\nfor (i = 0; i \u003C l.length; i\u002B\u002B) {\r\n node = l[i];\r\n count\u002B\u002B;\r\n}\r\nfor (i = 0; i \u003C l.length; i\u002B\u002B) {\r\n node = l[i];\r\n count\u002B\u002B;\r\n}","IsDeferred":false},{"Name":"Using childNodes","Code":"var node,\r\n childNodes = list.childNodes,\r\n count = 0,\r\n i,\r\n len = childNodes.length;\r\nfor (i = 0; i \u003C len; i\u002B\u002B) {\r\n node = childNodes[i];\r\n count\u002B\u002B;\r\n}\r\nfor (i = 0; i \u003C len; i\u002B\u002B) {\r\n node = childNodes[i];\r\n count\u002B\u002B;\r\n}","IsDeferred":false}]}