Learn Introductory JavaScript by Building a Pyramid Generator - Step 66

Tell us what’s happening:

I think it’s something small that I am missing please help I have been stuck. I dont understand why it says I’m not using padRow in the function 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);
}

// User Editable Region


let result = ""

for (const row of rows) {
  result = result + row + "\n";
}

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/131.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 66

you are missing something to call the function
try to confront with other function calls, for example the push there

i thought he .push was calling the function?

you are calling .push, yes, but you are not calling padRow

im struggling with understanding that. i thought the purpose of putting padRow in the .push parenthesis’s was calling padRow to the function?

you need to call padRow to get the output of padRow, you call push to put the output in the array

i get that i need to call padRow, but I’m saying that I don’t understand how to do that. i thought the purpose of .push() was to call padRow

when you call push you add what you passed to it to the array, it can’t call other functions on its own

what do you do to call push? what characters do you write?

by putting . in front of push and () after?

only the () after, but yes

so, now that we have reviewed what is needed to call a function, try to do the same for padRow

so do I not need rows. before the push? Where I’m supposed to put padRow is confusing

Ok i figured it out but i think i need to review some more on why is it working now. I appreciate all the help.