{"ScriptPreparationCode":null,"TestCases":[{"Name":"map","Code":"const events = [];\r\nlet max = 1000;\r\n\r\nwhile (max \u003E 0) {\r\n\tevents.push({ id: max, title: \u0060t ${max}\u0060});\r\n\tmax --;\r\n}\r\n\r\nconst event = { id: 500, title: \u0027foo\u0027 };\r\nconst index = events.findIndex((el) =\u003E el.id === event.id);\r\n\r\n let updated;\r\n\r\n if (index === -1) {\r\n updated = [ ...events.slice(0, index), event, ...events.slice(index \u002B 1) ];\r\n } else {\r\n updated = [ ...events, event ];\r\n }","IsDeferred":false},{"Name":"slice","Code":"const events = [];\r\nlet max = 1000;\r\n\r\nwhile (max \u003E 0) {\r\n\tevents.push({ id: max, title: \u0060t ${max}\u0060});\r\n\tmax --;\r\n}\r\n\r\nconst event = { id: 500, title: \u0027foo\u0027 };\r\nconst index = events.findIndex((el) =\u003E el.id === event.id);\r\n\r\n let updated;\r\n\r\n if (index === -1) {\r\n updated = [ ...events.slice(0, index), event, ...events.slice(index \u002B 1) ];\r\n } else {\r\n updated = [ ...events, event ];\r\n }","IsDeferred":false}]}