{"ScriptPreparationCode":"const iterationNum = 250000;\r\nconst possible = \u0022ACDEFGHIJKLMNOPQRSTUVWXYZ0123456789acdefghijklmnopqrstuvwxyz\u0022; // The letter B (and b) is removed\r\nconst possibleLen = possible.length;\r\n\r\nfunction getRandomIntInclusive(max, min = 1) {\r\n const minCeiled = Math.ceil(min);\r\n const maxFloored = Math.floor(max);\r\n return Math.floor(Math.random() * (maxFloored - minCeiled \u002B 1) \u002B minCeiled); // The maximum is inclusive and the minimum is inclusive\r\n}\r\n\r\nfunction makeRandomString(len, defaultWord = \u0027\u0027) {\r\n let text = defaultWord;\r\n for(let i = 0; i \u003C len; i\u002B\u002B) {\r\n text \u002B= possible.charAt(getRandomIntInclusive(possibleLen, 0));\r\n }\r\n return text \u002B defaultWord;\r\n}\r\n\r\nconst testWord = window.testWord = makeRandomString(getRandomIntInclusive(10)) \u002B \u0027Bb\u0027; // B or b shouldn\u0027t be in any generated word\r\nconst allStrings = window.allStrings = new Array(iterationNum);\r\nconst numberOfStrings = window.numberOfStrings = iterationNum;\r\n\r\nfor(let i = 0; i \u003C numberOfStrings; i\u002B\u002B) {\r\n allStrings[i] = makeRandomString(getRandomIntInclusive(20), testWord);\r\n}","TestCases":[{"Name":"Value Not Found - string.startsWith method","Code":"let x = 0;\r\nconst numberOfStrings = window.numberOfStrings;\r\nconst allStrings = window.allStrings;\r\nconst testWord = window.testWord;\r\nwhile (x \u003C numberOfStrings) {\r\n const str = allStrings[x];\r\n str.startsWith(testWord);\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"Value Not Found - string.indexOf method","Code":"let x = 0;\r\nconst numberOfStrings = window.numberOfStrings;\r\nconst allStrings = window.allStrings;\r\nconst testWord = window.testWord;\r\nconst testWordLen = testWord.length;\r\nwhile (x \u003C numberOfStrings) {\r\n const str = allStrings[x];\r\n str.indexOf(testWord) === 0;\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"Value Not Found - string.search method","Code":"let x = 0;\r\nconst numberOfStrings = window.numberOfStrings;\r\nconst allStrings = window.allStrings;\r\nconst testWord = window.testWord;\r\nconst testWordLen = testWord.length;\r\nwhile (x \u003C numberOfStrings) {\r\n const str = allStrings[x];\r\n str.search(testWord) === 0;\r\n x \u002B= 1;\r\n}","IsDeferred":false},{"Name":"Value Not Found - string.match method","Code":"let x = 0;\r\nconst numberOfStrings = window.numberOfStrings;\r\nconst allStrings = window.allStrings;\r\nconst testWord = window.testWord;\r\nconst testWordRegExp = new RegExp(\u0060^${testWord}\u0060);\r\nwhile (x \u003C numberOfStrings) {\r\n const str = allStrings[x];\r\n str.match(testWordRegExp); \r\n x \u002B= 1;\r\n}","IsDeferred":false}]}