{"ScriptPreparationCode":"var elements = new Array(1000);\r\nelements = elements.map((_, i) =\u003E ({ id: i, value: i * 100}));\r\n\r\nvar newElement = { id: 123, value: 15 };","TestCases":[{"Name":"spread clone with filter","Code":"elements = [...elements.filter((s) =\u003E s.is !== newElement.id), newElement];","IsDeferred":false},{"Name":"find by index then replace","Code":"var index = elements.findIndex((s) =\u003E s.id === newElement.id);\r\nif (index !== -1) {\r\n elements[index] = newElement;\r\n}","IsDeferred":false}]}