Learn Introductory JavaScript by Building a Pyramid Generator - Step 74

Tell us what’s happening:

Where and how manny arguments are in the editable code, nothing seems to be working for 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 + 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 74

my arguments were the (i + 1, count)
i + 1 …being the 1st
count …being the 2nd

Did you read the error message ?


cause this is what the challenge needs:

Update the first argument of your padRow call to be i.

1 Like

Yes, I had to reread to find my solution.

1 Like