Learn Introductory JavaScript by Building a Pyramid Generator - Step 99

Tell us what’s happening:

What is lacking in here? I’ve already added false as the iteration statement. Pls help …

Your code so far

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

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
  rows.push(padRow(i, count));
}*/

/*while (rows.length < count) {
  rows.push(padRow(rows.length + 1, count));
}*/


// User Editable Region

for (let i = count; false; i = false;) {

}

// 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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Mobile Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 99

Hi! You don’t need to include the i = for your iteration statement.

1 Like

I tried removing the i = as you’ve mentioned, but it still says that I need to use false as the iteration

1 Like

Did you also try removing the semicolon for the iteration statement?

1 Like

Well, I completely forgot that after removing the i =. That’s my bad, and also that seemed to solved it.
Greatly appreciate your help. Thank you!

1 Like

No problem! Glad to help :smiling_face: