{"ScriptPreparationCode":"var test_element_has = document.getElementById(\u0022foo\u0022);\r\nvar test_element_hasnt = document.getElementById(\u0022blarg\u0022);","TestCases":[{"Name":"className.indexOf before remove","Code":"function remove(elem) {\r\n if( elem.className.indexOf(\u0027bar\u0027) != -1 )\r\n elem.classList.remove(\u0027bar\u0027);\r\n}\r\n\r\nremove(test_element_has);\r\nremove(test_element_hasnt);","IsDeferred":false},{"Name":"classList.contains before remove","Code":"function remove(elem) {\r\n if( elem.classList.contains(\u0027bar\u0027) != -1 )\r\n elem.classList.remove(\u0027bar\u0027);\r\n}\r\n\r\nremove(test_element_has);\r\nremove(test_element_hasnt);","IsDeferred":false},{"Name":"classList.remove without checking","Code":"function remove(elem) {\r\n elem.classList.remove(\u0027bar\u0027);\r\n}\r\n\r\nremove(test_element_has);\r\nremove(test_element_hasnt);","IsDeferred":false},{"Name":"className splice","Code":"function remove(elem) {\r\n elem.className = elem.className.replace(\u0027bar\u0027,\u0027\u0027);\r\n}\r\n\r\nremove(test_element_has);\r\nremove(test_element_hasnt);","IsDeferred":false}]}