Learn Introductory JavaScript by Building a Pyramid Generator - Step 87

Tell us what’s happening:

hey guys is my code missing something
while (continueLoop) {
done++;
if (done == count)

}

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

}

// User Editable Region


let result = ""

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

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 87

Please talk to us about what you’ve tried to figure out what’s wrong.

1 Like

hey . the instructions are below your donee++ ad an if statement if statement must check if done is equal to count using the equality operator. So i input if (done == count). below my done++ argument is there a syntax error or is the code misplaced?

check your if statement, isn’t something missing there?

1 Like

is it the semi column.? or is it a parameter ?

I wouldn’t guess. I would look at examples you’ve seen.

i added semi-column and now it says i have to use equality operator == but that isn’t missing

Did you look at examples of if statements or did you just guess that a ; was needed?

I kinda guessed but I’m looking at if else i see the examples open curly brackets. i dadde them it passed thanks

1 Like