Learn Introductory JavaScript by Building a Pyramid Generator - Step 74

Tell us what’s happening:

I can’t pass this part. I can’t figure out what’s wrong here. It looks right to me.

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


// User Editable Region

for (let i = 1; i < count; i++) {
  rows.push(padRow(i));
}

// 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; rv:130.0) Gecko/20100101 Firefox/130.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 74

Hi. You have updated the first argument correctly but you have deleted the second argument pushed to the Padrow function which takes 2 arguments. If you reset and get your code back and try again.

Thank you! I didn’t realize it needed two arguments.

1 Like

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