Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

I can’t understand the problem I’m using the .return() method on my character variable , how can I fix it

My code so far

const character = “#”;
const count = 8;
const rows = ;

function padRow(rowNumber, rowCount) {
return character.repeat(rowNumber);
}

for (let i = 0; i < count; i = i + 1) {
rows.push(padRow(i + 1, count));
}

let result = “”;
for (const row of rows) {
result = result + “\n” + row;
}

console.log(result);

Welcome to the forum @Pietro

You modified the the code in the for loop, which the instructions did not ask you to do.

Please reset the step to restore the original code, and try again.

Happy coding

I’m trying to rest but it’s not working can you send me the original code for the for loop please

const character = “#”;

const count = 8;

const rows = ;

function padRow(rowNumber, rowCount) {

return character.repeat(rowNumber);

}

for (let i = 0; i < count; i = i + 1) {

rows.push(character.repeat(i + 1))

}

let result = “”

for (const row of rows) {

result = result + “\n” + row;

}

console.log(result);