{"ScriptPreparationCode":"var data = []\r\nvar out\r\n\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B)\r\n data.push({ date: new Date(Math.round(Date.now() * Math.random())).toISOString(), id: Math.floor(i / 25) })\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B)\r\n data.push({ date: new Date(Math.round(Date.now() * Math.random())).toISOString(), id: Math.round(Math.random() * 5) })","TestCases":[{"Name":"Every time date parse","Code":"out = []\r\nfor (let i = 0; i \u003C data.length; i\u002B\u002B) {\r\n const last = out[out.length - 1]\r\n const { id, date } = data[i]\r\n if (last \u0026\u0026 last.id === id)\r\n last.date = new Date(date)\r\n else\r\n \tout.push({ id, date: new Date(date) })\r\n}","IsDeferred":false},{"Name":"Parse in second loop","Code":"out = []\r\nfor (let i = 0; i \u003C data.length; i\u002B\u002B) {\r\n const last = out[out.length - 1]\r\n const { id, date } = data[i]\r\n if (last \u0026\u0026 last.id === id)\r\n last.date = date\r\n else\r\n \tout.push({ id, date: date })\r\n}\r\nfor (let i = 0; i \u003C out.length; i\u002B\u002B)\r\n out[i].date = new Date(out[i].date)","IsDeferred":false}]}