{"ScriptPreparationCode":"var array = [];\r\nvar map = new Map();\r\nvar obj = {};\r\n\r\nfor (var i = 0; i \u003C 20; i\u002B\u002B){\r\n array.push(Math.floor(Math.random()*5));\r\n map.set(i,true);\r\n obj[i]=true;\r\n}\r\nvar sorted = array.sort()\r\n\r\nfunction binaryIndexOf(searchElement) {\r\n var minIndex = 0;\r\n var maxIndex = this.length - 1;\r\n var currentIndex;\r\n var currentElement;\r\n while (minIndex \u003C= maxIndex) {\r\n currentIndex = (minIndex \u002B maxIndex) / 2 | 0;\r\n currentElement = sorted[currentIndex];\r\n \r\n if (currentElement \u003C searchElement) {\r\n minIndex = currentIndex \u002B 1;\r\n }\r\n else if (currentElement \u003E searchElement) {\r\n maxIndex = currentIndex - 1;\r\n }\r\n else {\r\n return currentIndex;\r\n }\r\n }\r\n \r\n return -1;\r\n}","TestCases":[{"Name":"includes","Code":"sorted.includes(Math.floor(Math.random()*7))","IsDeferred":false},{"Name":"binary","Code":"binaryIndexOf(Math.floor(Math.random()*7))","IsDeferred":false},{"Name":"indexof","Code":"sorted.indexOf(Math.floor(Math.random()*7))","IsDeferred":false}]}