{"ScriptPreparationCode":"var size = 1000000;\r\nvar arr = [];\r\n\r\nfor (var i=0; i \u003C size; i\u002B\u002B) {\r\n arr.push(i);\r\n}","TestCases":[{"Name":"All finds in one loop","Code":"var index1 = -1;\r\nvar index2 = -1;\r\nvar index3 = -1;\r\nvar index4 = -1;\r\nvar index5 = -1;\r\n\r\nfor (var ii=0; ii \u003C arr.length; ii\u002B\u002B) {\r\n if (i === 23423) {\r\n index1 = i;\r\n } else if (i === 3453) {\r\n \tindex2 = i;\r\n } else if (i === 9877) {\r\n \tindex3 = i;\r\n } else if (i === 39248) {\r\n \tindex4 = i;\r\n } else if (i === 908098) {\r\n \tindex5 = i;\r\n }\r\n}","IsDeferred":false},{"Name":"Manual finds with multiple loops","Code":"function findIndex(list, thing) {\r\n var foundIndex = -1;\r\n\r\n for (var i=0; i \u003C list.length; i\u002B\u002B) {\r\n if (i === thing) {\r\n foundIndex = i;\r\n }\r\n }\r\n\r\n return foundIndex;\r\n}\r\n\r\nvar index1 = findIndex(arr, 23423);\r\nvar index2 = findIndex(arr, 3453);\r\nvar index3 = findIndex(arr, 9877);\r\nvar index4 = findIndex(arr, 39248);\r\nvar index5 = findIndex(arr, 908098);","IsDeferred":false}]}