{"ScriptPreparationCode":"var collection=[],i;\r\nvar toCheck=[];\r\nfor(i=0;i\u003C10000;i\u002B\u002B){\r\n let a=Math.floor(Math.random()*1000)\u002B1;\r\n let b=Math.floor(Math.random()*100)\u002B1;\r\n let c=Math.floor(Math.random()*10)\u002B1;\r\n let d=Math.floor(Math.random()*10000)\u002B1;\r\n if(i==5000)\r\n toCheck=[\u0022a\u0022,a ,\u0022b\u0022,b];\r\n collection.push({\u0022a\u0022:a,\u0022b\u0022:b,\u0022c\u0022:c,\u0022d\u0022:d});\r\n}\r\n\r\nvar indexOf = (function(){\r\n \tvar isArray = Array.isArray;\r\n return function(collection,predicate,fromIndex){\r\n \tlet catchedElemIndex = -1;\r\n \tif(!isArray(collection)) return -1;\r\n \tlet len = collection.length;\r\n \tlet startIndex = (fromIndex === undefined)?0:((fromIndex\u002Blen)%len);\r\n if(typeof(predicate) === \u0027function\u0027){\r\n for(let i=startIndex;i\u003Clen;i\u002B\u002B){\r\n if(predicate(collection[i]) === true){\r\n catchedElemIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n else if(isArray(predicate)){\r\n for(let i=startIndex;i\u003Clen;i\u002B\u002B){\r\n\t\t\t\tif(collection[i][predicate[0]] === predicate[1]){\r\n catchedElemIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n \tvar toCheck = predicate;\r\n for(let i=startIndex;i\u003Clen;i\u002B\u002B){\r\n if(collection[i].hasOwnProperty(toCheck)){\r\n catchedElemIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n return catchedElemIndex;\r\n }\r\n}());\r\n","TestCases":[{"Name":"Lodash","Code":"_.findIndex(collection,toCheck);","IsDeferred":false},{"Name":"ClosureBased","Code":"indexOf(collection,toCheck);","IsDeferred":false}]}