Learn Introductory JavaScript by Building a Pyramid Generator - Step 94

Tell us what’s happening:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 94

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));
}*/

/*while (rows.length < count) {
  rows.push(padRow(rows.length + 1, count));
}*/


// User Editable Region

for (let i = count; false; i -= 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/125.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 94

Hello!

This is your iterator, assign it the boolean false like how you have done with your condition.

I don’t understand. This is my solution that produces the wanted output. freeCodeCamp will not accept it but I think the response is nonsensical.

Learning javascript step 94 problem.

Inputting this code:

for ( let i = count; i > 0; i-- ) {
rows.push(padRow( i, count ) );
}

Gives me the following output:

/ running tests
Your for loop should use false as the condition.
Your for loop should use false as the iteration.
// tests completed
// console output

###############
#############
###########
#########
#######
#####
###
#

What is wrong.

Your for loop should use false as the condition.
Your for loop should use false as the iteration.

Please open a new topic for your question.

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.