---
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;; //top gift"
url: "https://hashnode.com/posts/adventjs-2023-day-7-challenge/6573f24a037759c716a0a248/comment/658ec8bf1692adb30db737a0"
---

[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/658ec8bf1692adb30db737a0)

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

//top gift += (" ".repeat(size - 1) + "#".repeat(size) + "\\n");

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

mediumTop += spaces + hash + symbols1 + hash + symbols2 + hash + newLine; } gift += (mediumTop);

//medium gift += ("#".repeat(size) + symbol.repeat(size - 2) + "#" + "\\n");

//medium down let mediumDown = ""; for (let i = 0; i < size - 2; i++) { let hash = "#"; let symbols1 = symbol.repeat(size - 2); let symbols2 = symbol.repeat(size - i - 3); let newLine = "\\n";

mediumDown += hash + symbols1 + hash + symbols2 + hash + newLine; }

gift += (mediumDown);

//down gift += ("#".repeat(size) + "\\n"); return gift; }
