{"ScriptPreparationCode":"function hasWithIndexOf(needle, haystack) {\r\n\treturn haystack.indexOf(needle) !== -1;\r\n}\r\n\r\nfunction hasWithMapForEach(needle, haystack) {\r\n\tvar map = {};\r\n\thaystack.forEach(item =\u003E map[item] = true);\r\n\treturn map[needle];\r\n}\r\n\r\nfunction hasWithMapLoop(needle, haystack) {\r\n\tvar map = {};\r\n\tfor (var i=0, len=haystack.length; i\u003Clen; \u002B\u002Bi) {\r\n \tmap[haystack[i]] = true;\r\n }\r\n\treturn map[needle];\r\n}\r\n \r\nvar testArray = [];\r\nfor (var i=0; i\u003C100; \u002B\u002Bi) {\r\n \ttestArray.push(\u002700\u0027 \u002B i);\r\n}","TestCases":[{"Name":"indexOf","Code":"for (var i=0; i\u003C100; \u002B\u002Bi) {\r\n\thasWithIndexOf(\u0027404\u0027, testArray);\r\n}","IsDeferred":false},{"Name":"map with forEach","Code":"for (var i=0; i\u003C100; \u002B\u002Bi) {\r\n\thasWithMapForEach(\u0027404\u0027, testArray);\r\n}","IsDeferred":false},{"Name":"map with loop","Code":"for (var i=0; i\u003C100; \u002B\u002Bi) {\r\n\thasWithMapLoop(\u0027404\u0027, testArray);\r\n}","IsDeferred":false}]}