{"ScriptPreparationCode":"// Define the custom function\r\nElement.prototype.classCheck = function(classArray) {\r\n for (let i = 0; i \u003C classArray.length; i\u002B\u002B) {\r\n if (!this.classList.contains(classArray[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n};\r\n\r\n// Select the element once so we aren\u0027t benchmarking DOM selection\r\nvar el = document.getElementById(\u0027test-el\u0027);\r\nvar classesToTest = [\u0027primary\u0027, \u0027loading\u0027];\r\nvar selectorToTest = \u0027.primary.loading\u0027;","TestCases":[{"Name":"Chained Native \u0060contains\u0060","Code":"return el.classList.contains(\u0027primary\u0027) \u0026\u0026 el.classList.contains(\u0027loading\u0027);","IsDeferred":false},{"Name":"Custom .classCheck()","Code":"return el.classCheck(classesToTest);","IsDeferred":false},{"Name":"Native .matches()","Code":"return el.matches(selectorToTest);","IsDeferred":false}]}