Hello
{"ScriptPreparationCode":"var node = document.getElementById(\u0027node\u0027);\r\nvar $node = $(node);\r\nvar rx = new RegExp(\u0027\\\\bfoobar\\\\b\u0027);\r\nvar rx2 = new RegExp(\u0027(^| )foobar( |$)\u0027, \u0027gi\u0027);\r\nvar rx3 = new RegExp(\u0027(^| )foobar( |$)\u0027);\r\nvar rx4 = new RegExp(\u0027(^| )foobar( |$)\u0027, \u0027g\u0027);\r\nvar rx5 = new RegExp(\u0027(^| )foobar( |$)\u0027, \u0027i\u0027);\r\nfunction hasClassString(e, c) {\r\n var s = e.className, i = s.indexOf(c);\r\n return i != -1 \u0026\u0026 (s.charCodeAt(i - 1) || 32) == 32 \u0026\u0026 (s.charCodeAt(i \u002B c.length) || 32) == 32;\r\n};","TestCases":[{"Name":"$.hasClass","Code":"var hasClass = $node.hasClass(\u0027foobar\u0027);","IsDeferred":false},{"Name":"RegExp","Code":"var hasClass = rx.test(node.className);","IsDeferred":false},{"Name":"Dry RegExp","Code":"var drx = new RegExp(\u0027\\\\bfoobar\\\\b\u0027);\r\nvar hasClass = drx.test(node.className);","IsDeferred":false},{"Name":"indexOf","Code":"var hasClass = (\u0022 \u0022 \u002B node.className \u002B \u0022 \u0022).indexOf(\u0022 foobar \u0022) !== -1;\r\n","IsDeferred":false},{"Name":"classList","Code":"var hasClass = node.classList.contains(\u0027foobar\u0027);\r\n","IsDeferred":false},{"Name":"hasClassString","Code":"var hasClass = hasClassString(node, \u0027foobar\u0027);","IsDeferred":false},{"Name":"RegExp 2","Code":"var hasClass = rx2.test(node.className)","IsDeferred":false},{"Name":"RegExp 3","Code":"var hasClass = rx3.test(node.className)","IsDeferred":false},{"Name":"RegExp 4","Code":"var hasClass = rx4.test(node.className)","IsDeferred":false},{"Name":"RegExp 5","Code":"var hasClass = rx4.test(node.className)","IsDeferred":false},{"Name":"indexOf simplest","Code":"var hasClass = (node.className).indexOf(\u0022foobar\u0022) !== -1;\r\n","IsDeferred":false}]}