{"ScriptPreparationCode":"var oldData = Array.from({\r\n length: 1000000\r\n}, (_, index) =\u003E ({\r\n id: index \u002B 1,\r\n name: \u0060name_${index\u002B1}\u0060\r\n}));\r\n\r\nvar row = {\r\n id: 532\r\n}\r\n\r\nfunction sliceMethod(oldData, row){\r\n const index = oldData.findIndex(\r\n item =\u003E item.id === row.id\r\n );\r\n return {\r\n queues: {\r\n data: [\r\n ...oldData.slice(0, index),\r\n {\r\n ...oldData[index],\r\n active: true,\r\n version: String(\r\n \u002BoldData[index].version \u002B 1\r\n )\r\n },\r\n ...oldData.slice(index \u002B 1)\r\n ]\r\n }\r\n };\r\n}\r\n\r\nfunction mapMethod(oldData, row){\r\n const data = oldData.map(item =\u003E {\r\n if (item.id !== row.id) return item\r\n return {\r\n ...item,\r\n active: true,\r\n version: String(\u002Bitem.version \u002B 1)\r\n };\r\n })\r\n return {\r\n queues: {\r\n data\r\n }\r\n };\r\n}","TestCases":[{"Name":"Map Method","Code":"mapMethod(oldData, row);","IsDeferred":false},{"Name":"Slice Method","Code":"sliceMethod(oldData,row);","IsDeferred":false}]}