Learn Introductory JavaScript by Building a Pyramid Generator - Step 65

Tell us what’s happening:

function repeatCharacter(character, rowNumber) {

return character.repeat(rowNumber);

}
Hello. Something is wrong with my code. Please, help me.

Your code so far

const character = "#";
const count = 8;
const rows = [];


// User Editable Region

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

// User Editable Region



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);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 65

You weren’t asked to change the parameter to your function.

1 Like

Can you please try to explain more? It’s impossible to know what you are thinking.

Do you have a question about how to use a certain syntax?

Is there a wording in the instructions that’s not clear or confusing?

1 Like

Thanks, your advice has helped me to finish this step and the whole project.


1 Like

Thank you for your answer, but the problem has already been solved.

1 Like

I think it would be helpful for you (and the people trying to help you) if you can try describing your code and the problem you’re having.

Sometimes, in typing out the problem you discover the solution yourself.

1 Like

Okay, that’s what I’ll do. It happens that when you start digging into a problem and describing it, it resolves itself, although it takes time.

1 Like

Well done, you’ve made good progress.

1 Like

Thanks, it’s due to your help, of course.

1 Like