Learn Introductory JavaScript by Building a Pyramid Generator - Step 89

Tell us what’s happening:

Here in step 89. I need to assign a Boolean which is false to the continueLoop inside the “if” function body. I have done this and got stuck here.

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));
}*/

let continueLoop = false;
let done = 0;

while (continueLoop) {
  done++;

// User Editable Region

  if (done === count) {
    let continueLoop=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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 89

to reassign a value to an existing variable, don’t use let

Thank you. It worked. Also could you please help me with this. I am a beginner and at this point I understand some concepts but can’t understand some . Is it normal? Also I am feeling interesting as well as hard at the same time.

yes, you are a beginner. Ask for help, find other sources, keep learning about the topics you don’t understand until you understand them, then learn new things and find new things you don’t understand.