As the vertex row should have one character, the following lines should be corrected:
line 10: for (let i = 0; i < numRows; i++) {
line 15: for (let i = numRows-1; i >= 0; i--) {
And as each row should be aligned in center, in line 11 and 16 the spaces must be filled enough: let row = " ".repeat(numRows-i-1) + stri.repeat(2*i + 1);
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
Got it, thanks for the heads-up! I see how giving hints and asking the right questions helps others learn better than just handing over the full solution. I’ll keep that in mind and focus more on guiding than giving away answers. Appreciate the reminder!