Learn Introductory JavaScript by Building a Pyramid Generator - Step 82

Tell us what’s happening:

Здравствуйте! Не пойму, что не правильно в моем коде?

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 (done !== count) {
   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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 YaBrowser/24.4.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 82

Вы должны использовать оператор if в своем цикле.
Ваш if оператор должен использовать оператор равенства для сравнения
done и count в условии

Instructions for the challenge step is:
Add an if statement to your loop. The statement should check if done is equal to count using the equality operator.
Your comparison is checking if done is not equal to count.

Also you assigned false to continueLoop, that is not asked in the challenge step.

Вот так я исправила, но что-то все равно не правильно
while (done == count) {
done++;
rows.push(padRow(done, count));
if(done == count);
}

You have a semicolon ; after your if condition. Remove that and also you need empty body{} for your if statement

И опять не получается
while (done == count) {
done++;
rows.push(padRow(done, count));
if (done == count) {
}
}

While (continueLoop)
You have modified your while loop condition also. Correct it to what you had previously.

Вот поменяла
while (continueLoop) {
done++;
rows.push(padRow(done, count));
if(done == count) {}
}
И все равно пишет: Вы должны использовать оператор if в своем цикле

remove this line, why did you add it?

СПАСИБО!!! Все получилось!!! СПАСИБО!!!