Learn Introductory JavaScript by Building a Pyramid Generator - Step 81

Hey! Can anyone help with this step? Where should I put the done variable

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++) {

}

// User Editable Region


let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);

Hi there!
Reset your challenge and add increment done++ within loop body {}

Thank you @hasanzaib1389 , It worked :)…

1 Like

It’s my pleasure. Happy Coding.