{"ScriptPreparationCode":null,"TestCases":[{"Name":"reverse","Code":"function createStars(num) {\r\n let result = [];\r\n for (let i = 1; i \u003C= num; i\u002B\u002B) {\r\n result.push(\u0060${\u0022*\u0022.repeat(2 * i - 1)}\u0060);\r\n }\r\n result.push(...result.slice(0, -1).reverse());\r\n return result.join(\u0022\\n\u0022);\r\n}\r\nconsole.log(createStars(3));","IsDeferred":false},{"Name":"for","Code":"function createStars(num) {\r\n let result = \u0022\u0022;\r\n for (let i = 1; i \u003C= num; i\u002B\u002B) {\r\n result \u002B= \u0060${\u0022*\u0022.repeat(2 * i - 1)}\\n\u0060;\r\n }\r\n for (let i = num - 1; i \u003E 0; i--) {\r\n result \u002B= \u0060${\u0022*\u0022.repeat(2 * i - 1)}\\n\u0060;\r\n }\r\n return result;\r\n}\r\nconsole.log(createStars(3));","IsDeferred":false}]}