Learn Introductory JavaScript by Building a Pyramid Generator - Step 41

Tell us what’s happening:

Hi everyone!

I have been trying to solve this very challenge since yesterday, but could not solve till this moment.

Please I an assistance, or who to guild me and explain it to my understanding.

Here is my code below:

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

Your code so far

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


// User Editable Region

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

// User Editable Region


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 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 41

hi everyone!

I have been on this very challenge since yesterday and yet to pass. Please can anyone assist me here?

My code below:

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

To fix this, add 1 to the value of i in your .repeat() call.

You haven’t added 1 to the value of i. You have changed the value i to 1.

I don’t really know how to add 1 or exact place to add 1, please.

Please I need more understanding here

rows.push(character.repeat(i))

This is what you start with, so how would you change this to add 1 to i?

SOLUTION IS REMOVED by moderator

Please don’t post a solution, it is not allowed here on the forum. Only hints, advices, useful links are welcome
Thanks

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.