Test.
{"ScriptPreparationCode":"var div = document.getElementById(\u0022test\u0022);\r\n\r\nvar cachedRegExp = new RegExp(\u0022\\\\s*\\\\bghi\\\\b\\\\s*\u0022);\r\nvar cachedClassNamesAsString = \u0022abc def\u0022;\r\nvar cachedClassNamesAsArray = [\u0022abc\u0022, \u0022def\u0022];","TestCases":[{"Name":"classList","Code":"div.classList.toggle(\u0022ghi\u0022, true);","IsDeferred":false},{"Name":"RegExp with DOM access","Code":"div.className = div.className.replace(cachedRegExp, \u0022\u0022) \u002B \u0022 ghi\u0022;","IsDeferred":false},{"Name":"RegExp without DOM access","Code":"div.className = cachedClassNamesAsString.replace(cachedRegExp, \u0022\u0022) \u002B \u0022 ghi\u0022;","IsDeferred":false},{"Name":"Array","Code":"div.className = [...cachedClassNamesAsArray, \u0022ghi\u0022].join(\u0022 \u0022);","IsDeferred":false},{"Name":"String","Code":"div.className = cachedClassNamesAsString \u002B \u0022 ghi\u0022;","IsDeferred":false}]}