{"ScriptPreparationCode":"var arr = []\r\nvar map = new Map()\r\nvar set = new Set()\r\nvar obj = {}\r\n\r\nfor (var i = 0; i \u003C 2000; i\u002B\u002B) {\r\n arr.push(Math.random())\r\n map.set(i, true)\r\n set.add(i)\r\n obj[i] = true\r\n}\r\narr = arr.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\r\n while (minIndex \u003C= maxIndex) {\r\n currentIndex = (minIndex \u002B maxIndex) \u003E\u003E\u003E 1\r\n currentElement = this[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":"arr.includes(5)","IsDeferred":false},{"Name":"binary search","Code":"binaryIndexOf.call(arr, 5)","IsDeferred":false},{"Name":"Map.has()","Code":"map.has(5)","IsDeferred":false},{"Name":"Set.has()","Code":"set.has(5)","IsDeferred":false},{"Name":"Obj[]","Code":"obj[5]","IsDeferred":false}]}