Learn Introductory JavaScript by Building a Pyramid Generator - Step 90

Tell us what’s happening:

I added !== operator which is the only step for 90 where it made sense and still not able to pass I seemed for articles on the same topic and independently but still no luck code below

while (continueLoop) { done++; rows.push(padRow(done, count)); if (done !== count) { continueLoop = false; } }

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;


// User Editable Region

while (continueLoop) {
  done++;
  rows.push(padRow(done, count));
  if (done !== count) {
    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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 90

Welcome to the forum @RudyRomero92

Update your while loop condition to check if done is not equal to count.

Your code updated the if statement.
You need to update the while condition.

Happy coding

Thanks, Problem resolved!

1 Like

the instruction is: UPDATE your while loop CONDITION to check if done is not equal to count .

We are going to change WHILE CONDICION while (condition)
–removed–

Hi and welcome to the forum! :wave:

Please don’t post solution code and no need to respond to threads that were solved a month ago.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.