{"ScriptPreparationCode":"var domEl = document.createElement(\u0022span\u0022), cls = \u0022 aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbb \u0022, _hasCls = function(domEl, cls) {\r\n\t\t\tvar found\t= false,\r\n\t\t\t\tpos\t\t= domEl.className.indexOf(cls);\r\n\r\n\t\t\tif (pos \u003E= 0) {\r\n\t\t\t\tvar endpos = pos \u002B cls.length;\r\n\t\t\t\tfound = endpos == domEl.className.length || domEl.className.charAt(endpos) == \u0027 \u0027;\r\n\t\t\t}\r\n\r\n\t\t\treturn found;\r\n\t\t};","TestCases":[{"Name":"Old method","Code":"if (!_hasCls(domEl, cls)) {\r\n\t\t\t\t\tif (domEl.className.length \u003E 0) {\r\n\t\t\t\t\t\tcls = \u0027 \u0027 \u002B cls;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdomEl.className \u002B= cls;\r\n\t\t\t\t}","IsDeferred":false},{"Name":"New check","Code":"cls.split(\u0027 \u0027).forEach(function(onecls) {\r\n\t\t\t\t\tif (onecls)\r\n\t\t\t\t\t\tdomEl.classList.add(onecls);\r\n\t\t\t\t});","IsDeferred":false},{"Name":"New replace","Code":"cls.replace(/\\s\u002B/g, \u0027 \u0027).trim().split(\u0027 \u0027).forEach(function(onecls) {\r\n domEl.classList.add(onecls);\r\n});","IsDeferred":false}]}