{"ScriptPreparationCode":null,"TestCases":[{"Name":"For loop \u002B Array.push","Code":"const start = new Date(\u00222020-06-01\u0022);\r\nconst end = new Date(\u00222026-05-01\u0022);\r\nlet dates = [];\r\n\r\nfor (let currentDate = start; currentDate \u003C= end; currentDate.setMonth(currentDate.getMonth() \u002B 1)) {\r\n dates.push(currentDate.toISOString().split(\u0022T\u0022)[0]);\r\n}","IsDeferred":false},{"Name":"For loop \u002B Spread Operator","Code":"const start = new Date(\u00222020-06-01\u0022);\r\nconst end = new Date(\u00222026-05-01\u0022);\r\nlet dates = [];\r\n\r\nfor (let currentDate = start; currentDate \u003C= end; currentDate.setMonth(currentDate.getMonth() \u002B 1)) {\r\n dates = [...dates, currentDate.toISOString().split(\u0027T\u0027)[0]];\r\n}","IsDeferred":false},{"Name":"While \u002B Array.push","Code":"const start = new Date(\u00222020-06-01\u0022);\r\nconst end = new Date(\u00222026-05-01\u0022);\r\nlet dates = [];\r\nlet currentDate = start;\r\n\r\nwhile (currentDate \u003C= end) {\r\n dates.push(currentDate.toISOString().split(\u0022T\u0022)[0]);\r\n currentDate.setMonth(currentDate.getMonth() \u002B 1);\r\n }","IsDeferred":false},{"Name":"While \u002B Spread Operator","Code":"const start = new Date(\u00222020-06-01\u0022);\r\nconst end = new Date(\u00222026-05-01\u0022);\r\nlet dates = [];\r\nlet currentDate = start; \r\n\r\nwhile (currentDate \u003C= end) {\r\n dates = [...dates, currentDate.toISOString().split(\u0027T\u0027)[0]];\r\n currentDate.setMonth(currentDate.getMonth() \u002B 1);\r\n }","IsDeferred":false},{"Name":"Array.from","Code":"const start = new Date(\u00222020-06-01\u0022);\r\nconst end = new Date(\u00222026-05-01\u0022);\r\nlet dates = Array.from(\r\n { length: (end.getFullYear() - start.getFullYear()) * 12 },\r\n (_, i) =\u003E new Date(start.getFullYear(), start.getMonth() \u002B i, 1).toISOString().split(\u0027T\u0027)[0]\r\n );","IsDeferred":false}]}