{"ScriptPreparationCode":"const elementCount = 100000;\r\nconst body = document.getElementById(\u0027testBody\u0027);\r\n\r\n// Create a Bunch of DOM elements.\r\n// Keep a refrence to all of them to test the other loops.\r\nwindow.entities = [];\r\nfor (let i=0; i \u003C elementCount; i\u002B\u002B) {\r\n let elm = document.createElement(\u0027div\u0027);\r\n elm.classList.add(\u0060test-${i%4}\u0060);\r\n elm.setAttribute(\u0060test\u0060, i%4);\r\n // Add to body for query selector tests.\r\n body.appendChild(elm);\r\n // Add to array for loop tests.\r\n window.entities.push(elm);\r\n}","TestCases":[{"Name":"querySelectorAll with .class","Code":"const randomID = 0|Math.random()*4;\r\nconst result = window.testBody.querySelectorAll(\u0060.test-${randomID}\u0060);","IsDeferred":false},{"Name":"querySelectorAll with [attribute]","Code":"const randomID = 0|Math.random()*4;\r\nconst result = window.testBody.querySelectorAll(\u0060[test=\u0022${randomID}\u0022]\u0060);","IsDeferred":false},{"Name":"filter with classList","Code":"const randomID = 0|Math.random()*4;\r\nconst result = window.entities.filter(elm =\u003E elm.classList.contains(\u0060test-${randomID}\u0060))","IsDeferred":false},{"Name":"filter with className","Code":"const randomID = 0|Math.random()*4;\r\nconst result = window.entities.filter(elm =\u003E elm.className === \u0060test-${randomID}\u0060)","IsDeferred":false},{"Name":"filter with getAttribute","Code":"const randomID = 0|Math.random()*4;\r\nconst result = window.entities.filter(elm =\u003E elm.getAttribute(\u0027test\u0027) === \u0060${randomID}\u0060)","IsDeferred":false},{"Name":"for with classList","Code":"const randomID = 0|Math.random()*4;\r\nconst result = [];\r\nconst length = window.entities.length;\r\nfor (let i=0; i \u003C length; i\u002B\u002B) {\r\n const elm = window.entities[i];\r\n if (elm.classList.contains(\u0060test-${randomID}\u0060)) {\r\n result.push(elm);\r\n }\r\n}","IsDeferred":false},{"Name":"for with className","Code":"const randomID = 0|Math.random()*4;\r\nconst result = [];\r\nconst length = window.entities.length;\r\nfor (let i=0; i \u003C length; i\u002B\u002B) {\r\n const elm = window.entities[i];\r\n if (elm.className === \u0060test-${randomID}\u0060) {\r\n result.push(elm);\r\n }\r\n}","IsDeferred":false},{"Name":"for with getAttribute","Code":"const randomID = 0|Math.random()*4;\r\nconst result = [];\r\nconst length = window.entities.length;\r\nfor (let i=0; i \u003C length; i\u002B\u002B) {\r\n const elm = window.entities[i];\r\n if (elm.getAttribute(\u0027test\u0027) === \u0060${randomID}\u0060) {\r\n result.push(elm);\r\n }\r\n}","IsDeferred":false},{"Name":"getElementsByClassName","Code":"const randomID = 0|Math.random()*4;\r\nconst result = window.testBody.getElementsByClassName(\u0060test-${randomID}\u0060);","IsDeferred":false}]}