---
title: "Comment by Sergio Corredor on \"AdventJS 2023: Day 7 Challenge\" | Hashnode"
description: "function drawGift(size, symbol) { let gift = &quot;&quot;; if (size === 1) return &quot;#\\n&quot; if (size === 2) return &quot; ##\\n###\\n##\\n&quot; const NEW_LI"
url: "https://hashnode.com/posts/adventjs-2023-day-7-challenge/6573f24a037759c716a0a248/comment/658ecf6bf073040c2d2a485c"
---

[Discussion](https://hashnode.com/posts/adventjs-2023-day-7-challenge/6573f24a037759c716a0a248)

Comment [AdventJS 2023: Day 7 Challenge](https://hashnode.com/posts/adventjs-2023-day-7-challenge/6573f24a037759c716a0a248)

[Sergio Corredor](https://hashnode.com/@NeoAres)

[Dec 29, 2023](https://hashnode.com/posts/adventjs-2023-day-7-challenge/6573f24a037759c716a0a248/comment/658ecf6bf073040c2d2a485c)

function drawGift(size, symbol) { let gift = ""; if (size === 1) return "#\\n" if (size === 2) return " ##\\n###\\n##\\n" const NEW\_LINE = "\\n" const HASH = "#"

//top gift += (" ".repeat(size - 1) + HASH.repeat(size) + NEW\_LINE);

//medium top for (let i = 0; i < size - 2; i++) { let spaces = " ".repeat(size - 2 - i); let symbols1 = symbol.repeat(size - 2); let symbols2 = symbol.repeat(i);

gift += spaces + HASH + symbols1 + HASH + symbols2 + HASH + NEW\_LINE; }

//medium gift += (HASH.repeat(size) + symbol.repeat(size - 2) + HASH + NEW\_LINE);

//medium down for (let i = 0; i < size - 2; i++) { let symbols1 = symbol.repeat(size - 2); let symbols2 = symbol.repeat(size - i - 3);

gift += HASH + symbols1 + HASH + symbols2 + HASH + NEW\_LINE; }

//down gift += (HASH.repeat(size) + NEW\_LINE); return gift; }
