{"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 = [\u0027001\u0027, \u0027002\u0027, \u0027003\u0027, \u0027004\u0027, \u0027005\u0027, \u0027006\u0027, \u0027007\u0027, \u0027008\u0027, \u0027009\u0027, \u0027010\u0027, \u0027011\u0027, \u0027012\u0027, \u0027013\u0027, \u0027014\u0027, \u0027015\u0027, \u0027016\u0027, \u0027017\u0027, \u0027018\u0027, \u0027019\u0027, \u0027020\u0027];","TestCases":[{"Name":"indexOf","Code":"for (var i=0; i\u003C100; \u002B\u002Bi) {\r\n\thasWithIndexOf(\u0027000\u0027, testArray);\r\n}","IsDeferred":false},{"Name":"map with forEach","Code":"for (var i=0; i\u003C100; \u002B\u002Bi) {\r\n\thasWithMapForEach(\u0027000\u0027, testArray);\r\n}","IsDeferred":false},{"Name":"map with loop","Code":"for (var i=0; i\u003C100; \u002B\u002Bi) {\r\n\thasWithMapLoop(\u0027000\u0027, testArray);\r\n}","IsDeferred":false}]}