{"ScriptPreparationCode":"window.regexStart = /^test/;\r\nwindow.regexEnd = /test$/;\r\nwindow.match = \u0027test\u0027;\r\nwindow.matchLength = window.match.length;\r\nvar data = window.data = [];\r\nconst possible = \u0022ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\u0022;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS = 100000;\r\n\r\nfunction getRandomInt(max) {\r\n return Math.floor(Math.random() * max);\r\n}\r\n\r\nfunction makeRandomString(len) {\r\n var text = \u0022\u0022;\r\n for( var i=0; i \u003C len; i\u002B\u002B ) {\r\n text \u002B= possible.charAt(getRandomInt(possible.length));\r\n }\r\n return text;\r\n}\r\n\r\nwhile (data.length \u003C TOTAL_STRINGS) {\r\n data.push(makeRandomString(getRandomInt(20)));\r\n}","TestCases":[{"Name":"regex start","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar regex = window.regexStart;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n regex.test(str);\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"startsWith","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n str.startsWith(match) === 0;\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"regex end","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar regex = window.regexEnd;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n regex.test(str);\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"endsWith","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n str.endsWith(match) === 0;\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"indexOf start","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n str.indexOf(match) === 0;\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"indexOf end","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nvar length = window.matchLength;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n str.indexOf(match) === str.length - length;\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"charAt end","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nvar matchLen = match.length;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n if (str \u0026\u0026 str.length \u003E= matchLen) {\r\n let strLen = str.length;\r\n \tfor (let i = 1; i \u003C= matchLen; i\u002B\u002B) {\r\n \tif (str.charAt(strLen - i) !== match.charAt(matchLen - i))\r\n break;\r\n\t}\r\n }\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"charCodeAt end","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nvar matchLen = match.length;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n if (str \u0026\u0026 str.length \u003E= matchLen) {\r\n let strLen = str.length;\r\n \tfor (let i = 1; i \u003C= matchLen; i\u002B\u002B) {\r\n \tif (str.charCodeAt(strLen - i) !== match.charCodeAt(matchLen - i))\r\n break;\r\n\t}\r\n }\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"charCodeAt start","Code":"var x = 0;\r\nvar TOTAL_STRINGS = window.TOTAL_STRINGS;\r\nvar data = window.data;\r\nvar match = window.match;\r\nvar matchLen = match.length;\r\nwhile (x \u003C TOTAL_STRINGS) {\r\n const str = data[x];\r\n if (str \u0026\u0026 str.length \u003E= matchLen) {\r\n \tfor (let i = 0; i \u003C matchLen; i\u002B\u002B) {\r\n \tif (str.charCodeAt(i) !== match.charCodeAt(i))\r\n break;\r\n\t}\r\n }\r\n x \u002B= 1;\r\n}","IsDeferred":false}]}