{"ScriptPreparationCode":null,"TestCases":[{"Name":"flatMap","Code":"const workFromHour = 13;\r\nconst workToHour = 23;\r\nconst timeOptionsList = Array.from({\r\n length: workToHour - workFromHour,\r\n}).flatMap((_, index) =\u003E {\r\n const calculatedIntervalHour = \u002BworkFromHour \u002B index;\r\n return [{label: \u0060${calculatedIntervalHour}:00\u0060,\r\n value: \u0060${calculatedIntervalHour}:00\u0060,\r\n },\r\n {\r\n label: \u0060${calculatedIntervalHour}:30\u0060,\r\n value: \u0060${calculatedIntervalHour}:30\u0060,\r\n },\r\n ];\r\n}, []);\r\nconsole.log(timeOptionsList);","IsDeferred":false},{"Name":"reduce","Code":"const workFromHour = 13;\r\nconst workToHour = 23;\r\nconst timeOptionsList = Array.from({\r\n length: workToHour - workFromHour,\r\n}).reduce((acc, _, index) =\u003E {\r\n const calculatedIntervalHour = workFromHour \u002B index;\r\n return [\r\n ...acc,\r\n {\r\n label: \u0060${calculatedIntervalHour}:00\u0060,\r\n value: \u0060${calculatedIntervalHour}:00\u0060,\r\n },\r\n {\r\n label: \u0060${calculatedIntervalHour}:30\u0060,\r\n value: \u0060${calculatedIntervalHour}:30\u0060,\r\n },\r\n ];\r\n}, []);\r\nconsole.log(timeOptionsList);","IsDeferred":false}]}