Learn Introductory JavaScript by Building a Pyramid Generator - Step 61

Tell us what’s happening:

I can’t seem to figure this out in any way. Can anyone guide me to the right direction?

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" "+character.repeat(padRow)+" ";
}

// 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 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 61

Hello there.
This is what they want you to do, they want you to delete this

character.repeat(i + 1)

then replace it with a function call, calling this function

padRow

The instructions have already hinted on how to call a function.

Thank you! I tried that and it worked.

You do not need to concatenate. The + signs aren’t necessary.
character.repeat(i + 1) is not necessary anymore either.
Make sure to use the () after push . pass the function padRow() into the parentheses after push.