{"ScriptPreparationCode":null,"TestCases":[{"Name":"Array From","Code":"function createDateArrayInAMonth(year, month) {\r\n return Array.from(\r\n { length: new Date(year, month, 0).getDate() },\r\n (_, i) =\u003E new Date(year, month - 1, i \u002B 1).toLocaleString()\r\n )\r\n}\r\n\r\ncreateDateArrayInAMonth(2023, 10)","IsDeferred":false},{"Name":"new Array","Code":"function createDateArrayInAMonth(year, month) {\r\n return new Array(new Date(year, month, 0).getDate()).fill().map((_, i) =\u003E new Date(year, month - 1, i \u002B 1).toLocaleString())\r\n}\r\n\r\ncreateDateArrayInAMonth(2023, 10)","IsDeferred":false},{"Name":"Array","Code":"function createDateArrayInAMonth(year, month) {\r\n return Array(new Date(year, month, 0).getDate()).fill().map((_, i) =\u003E new Date(year, month - 1, i \u002B 1).toLocaleString())\r\n}\r\n\r\ncreateDateArrayInAMonth(2023, 10)","IsDeferred":false},{"Name":"for push","Code":"function createDateArrayInAMonth(year, month) {\r\n const arr = []\r\n \r\n for (let i = 0; i \u003C new Date(year, month, 0).getDate(); i\u002B\u002B) {\r\n arr.push(new Date(year, month - 1, i \u002B 1).toLocaleString())\r\n }\r\n \r\n return arr\r\n}\r\n\r\ncreateDateArrayInAMonth(2023, 10)","IsDeferred":false},{"Name":"for index","Code":"function createDateArrayInAMonth(year, month) {\r\n const arr = []\r\n \r\n for (let i = 0; i \u003C new Date(year, month, 0).getDate(); i\u002B\u002B) {\r\n arr[i] = new Date(year, month - 1, i \u002B 1).toLocaleString()\r\n }\r\n \r\n return arr\r\n}\r\n\r\ncreateDateArrayInAMonth(2023, 10)","IsDeferred":false},{"Name":"While","Code":"function createDateArrayInAMonth(year, month) {\r\n const date = new Date(year, month - 1, 1)\r\n const arr = []\r\n \r\n while (date.getMonth() === month - 1) {\r\n arr.push(new Date(date).toLocaleString())\r\n \r\n date.setDate(date.getDate() \u002B 1)\r\n }\r\n \r\n return arr\r\n}\r\n\r\ncreateDateArrayInAMonth(2023, 10)","IsDeferred":false}]}