Learn Introductory JavaScript by Building a Pyramid Generator - Step 86

Tell us what’s happening:

i followed the instructions in while loop, put true as condition of the loop and increment done inside ( i also tried to use condition as (done < count) but it didn’t work, please 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));
}*/

let continueLoop = false;
let done = 0;


// User Editable Region

while (true) {
  done += 1;
}

// 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/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 86

the Task is: start by using the increment operator to increase the value of the done variable inside your loop.

you use addition assignment operator not increment operator, reset the lesson and use increment operator to said variable and it’ll work

hey @xHeidelberg thanks for replying, did you mean “done++;”? It still didn’t work though

Hello and welcome to the forum!

It appears that some of the original code has been changed.

To removed any failed code for this step, I suggest reset (which will only affect this step).

Then, as stated in the previous post, just enter the increment operator onto done.
There is not any need for any equation, other than the done with the increment and the semicolon after it.

May your progress continue to be smooth.

thanks @GrannyIsA-Dreamer , problem solved! turns out its the parameter that i have changed to true

1 Like