{"ScriptPreparationCode":"const arraySize = 200; // Size of the array\r\nconst array = Array.from({ length: arraySize }, (_, i) =\u003E i); // Array of numbers from 0 to arraySize - 1\r\n\r\nconst randomIndex = Math.floor(Math.random() * (arraySize - 1)); // Random index in the array\r\nconst needle = array[randomIndex \u002B Math.floor(Math.random() * (arraySize - randomIndex - 1)) \u002B 1]; // Needle after the random index\r\n","TestCases":[{"Name":"For loop","Code":"let foundIndex = -1;\r\nfor (let i = randomIndex \u002B 1; i \u003C array.length; i\u002B\u002B) {\r\n if (array[i] === needle) {\r\n foundIndex = i;\r\n break;\r\n }\r\n}","IsDeferred":false},{"Name":"Slice","Code":"const slicedArray = array.slice(randomIndex \u002B 1);\r\nconst foundIndexInSlice = slicedArray.indexOf(needle);\r\nconst foundIndex = foundIndexInSlice !== -1 ? foundIndexInSlice \u002B randomIndex \u002B 1 : -1;","IsDeferred":false}]}