Learn Introductory JavaScript by Building a Pyramid Generator - Step 66

Tell us what’s happening:

Hello so i can’t figure this out, i looked up for the right way to do it and even like this the code does not pass… am i doing something wrong?

here is what it tells me : "You should call padRow in your .push() call.

Your code so far

const character = "#";
const count = 8;
const rows = [];

function padRow(rowNumber, rowCount) {
  return character.repeat(rowNumber);
}



// User Editable Region

for (let i = 0; i < count; i = i + 1) {
  rows.push(padRow(i + 1,  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/123.0.0.0 Safari/537.36 OPR/109.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 66

Maybe the problem with with i = 0, it draws nothing

Hello, i don’t think so because it is here from the previous challenges, but thanks for trying to help :smiley:

call padRow with no arguments

— solution removed —

what do the tests say?

Thanks that worked, it turn out i was overthinking for nothing :sweat_smile:

1 Like

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.