{"ScriptPreparationCode":"var people = [{\r\n name: \u0027juan\u0027,\r\n age: 18\r\n },\r\n {\r\n name: \u0027maria\u0027,\r\n age: 25\r\n },\r\n {\r\n name: \u0027luis\u0027,\r\n age: 32\r\n },\r\n {\r\n name: \u0027ana\u0027,\r\n age: 22\r\n },\r\n {\r\n name: \u0027pedro\u0027,\r\n age: 45\r\n },\r\n {\r\n name: \u0027carla\u0027,\r\n age: 28\r\n },\r\n {\r\n name: \u0027miguel\u0027,\r\n age: 34\r\n },\r\n {\r\n name: \u0027sofia\u0027,\r\n age: 29\r\n },\r\n {\r\n name: \u0027antonio\u0027,\r\n age: 60\r\n },\r\n {\r\n name: \u0027beatriz\u0027,\r\n age: 19\r\n },\r\n {\r\n name: \u0027fernando\u0027,\r\n age: 37\r\n },\r\n {\r\n name: \u0027valentina\u0027,\r\n age: 33\r\n },\r\n {\r\n name: \u0027ricardo\u0027,\r\n age: 48\r\n },\r\n {\r\n name: \u0027isabel\u0027,\r\n age: 26\r\n },\r\n {\r\n name: \u0027pablo\u0027,\r\n age: 40\r\n },\r\n {\r\n name: \u0027sara\u0027,\r\n age: 21\r\n },\r\n {\r\n name: \u0027alberto\u0027,\r\n age: 50\r\n },\r\n {\r\n name: \u0027juliana\u0027,\r\n age: 27\r\n },\r\n {\r\n name: \u0027rafael\u0027,\r\n age: 36\r\n },\r\n {\r\n name: \u0027natalia\u0027,\r\n age: 23\r\n },\r\n {\r\n name: \u0027diego\u0027,\r\n age: 30\r\n },\r\n {\r\n name: \u0027laura\u0027,\r\n age: 24\r\n },\r\n {\r\n name: \u0027daniel\u0027,\r\n age: 46\r\n },\r\n {\r\n name: \u0027monica\u0027,\r\n age: 31\r\n },\r\n {\r\n name: \u0027jorge\u0027,\r\n age: 38\r\n },\r\n {\r\n name: \u0027camila\u0027,\r\n age: 20\r\n },\r\n {\r\n name: \u0027linda\u0027,\r\n age: 41\r\n },\r\n {\r\n name: \u0027roberto\u0027,\r\n age: 58\r\n },\r\n {\r\n name: \u0027cristina\u0027,\r\n age: 44\r\n },\r\n {\r\n name: \u0027bruno\u0027,\r\n age: 39\r\n },\r\n {\r\n name: \u0027catalina\u0027,\r\n age: 35\r\n },\r\n {\r\n name: \u0027felipe\u0027,\r\n age: 55\r\n },\r\n {\r\n name: \u0027leticia\u0027,\r\n age: 42\r\n },\r\n {\r\n name: \u0027victor\u0027,\r\n age: 43\r\n },\r\n {\r\n name: \u0027marina\u0027,\r\n age: 47\r\n },\r\n {\r\n name: \u0027iv\u00E1n\u0027,\r\n age: 49\r\n },\r\n {\r\n name: \u0027angela\u0027,\r\n age: 53\r\n },\r\n {\r\n name: \u0027martin\u0027,\r\n age: 56\r\n },\r\n {\r\n name: \u0027estrella\u0027,\r\n age: 52\r\n },\r\n {\r\n name: \u0027gonzalo\u0027,\r\n age: 54\r\n },\r\n {\r\n name: \u0027santiago\u0027,\r\n age: 67\r\n },\r\n {\r\n name: \u0027ines\u0027,\r\n age: 59\r\n },\r\n {\r\n name: \u0027lucas\u0027,\r\n age: 62\r\n },\r\n {\r\n name: \u0027paula\u0027,\r\n age: 64\r\n },\r\n {\r\n name: \u0027javier\u0027,\r\n age: 70\r\n },\r\n {\r\n name: \u0027alicia\u0027,\r\n age: 61\r\n },\r\n {\r\n name: \u0027manuel\u0027,\r\n age: 63\r\n },\r\n {\r\n name: \u0027belen\u0027,\r\n age: 66\r\n },\r\n {\r\n name: \u0027francisco\u0027,\r\n age: 65\r\n },\r\n {\r\n name: \u0027jose\u0027,\r\n age: 68\r\n }\r\n];\r\n\r\nvar indicesG = [2, 4, 5, 6, 8, 10, 14, 20, 31, 32, 35, 40, 41];\r\nvar persistedRequests1 = [...people];\r\nvar persistedRequests2 = [...people];\r\nvar persistedRequests3 = [...people];","TestCases":[{"Name":"Splice","Code":"\r\nfunction removeRequestsByIndices(indices) {\r\n // Sort indices in descending order to avoid re-indexing issues when splicing\r\n indices.sort((a, b) =\u003E b - a);\r\n\r\n // Remove each request at the specified index\r\n indices.forEach(index =\u003E {\r\n if (index \u003E= 0 \u0026\u0026 index \u003C persistedRequests1.length) {\r\n persistedRequests1.splice(index, 1);\r\n }\r\n });\r\n}\r\nremoveRequestsByIndices(indicesG);","IsDeferred":false},{"Name":"Set-Filter","Code":"function removeRequestsByIndices(indices) {\r\n // Create a Set from the indices array for efficient lookup\r\n const indicesSet = new Set(indices);\r\n\r\n // Create a new array excluding elements at the specified indices\r\n persistedRequests2 = persistedRequests2.filter((_, index) =\u003E !indicesSet.has(index));\r\n}\r\nremoveRequestsByIndices(indicesG);","IsDeferred":false},{"Name":"Set-Loop","Code":"function removeRequestsByIndices(indices) {\r\n // Convert indices to a Set for faster lookup\r\n const indicesSet = new Set(indices);\r\n const newPersistedRequests = [];\r\n \r\n // Iterate over persistedRequests and build a new array excluding the specified indices\r\n for (let i = 0; i \u003C persistedRequests3.length; i\u002B\u002B) {\r\n if (!indicesSet.has(i)) {\r\n newPersistedRequests.push(persistedRequests3[i]);\r\n }\r\n }\r\n \r\n // Update the persisted requests\r\n persistedRequests3 = newPersistedRequests;\r\n}\r\nremoveRequestsByIndices(indicesG);","IsDeferred":false}]}