Learn Introductory JavaScript by Building a Pyramid Generator - Step 86

Tell us what’s happening:

how should i solve these, i tried to write in the loop an if statement and this is the format if(done == count) but i really wasn’t the code.

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) {
   if (done == count) {
     
   }
};

// 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/125.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 86

Welcome to the forum @PatrickMonteron12

Here is the original loop.

Where is the done++; code?

Happy coding

add the code below before the if statement.
done++;

this topic exist around 5+ request for help. Checked all of them.
One way why my solution doesnt work were white space …
done++1; this is what works… and my version was done ++ 1; doesnt work…

Ofc it means that is it important but in that case how someone can understand it that you cant make any white space between variable and + ?

Awful solution. Each code with done ++ 1 or mix of them should get tested and in case of that mistake it should give tip how to fix that… I spent 10 minutes wasted on something what should be clarified in 30 sec after my mistake… I am not begginer in languages…

if you have feedback on how to improve a test feel free to open an issue on github. The tests can’t cover every single possible code that the camper can write, but better tests are always good.

I am not sure that we can test for done++1 as that is a syntax error, you would see that in the console