Learn Introductory JavaScript by Building a Pyramid Generator - Step 49

Tell us what’s happening:

Confused about what the result of padRow call is. The hint says:

You should assign call the result of your padRow call.

But the problem is I don’t know what the result of it is. Any help will be amazing!!

Your code so far

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

function padRow() {

}

// User Editable Region

padRow();
const call = padRow;

// User Editable Region



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

let result = ""

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

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 49

Hi @ghost_bentley

On the line above the call variable declaration you are calling a function.

Happy coding

Hi @Teller, sorry for such a late reply, I’ve been busy this weekend. Thanks for the help but I am still a little bit confused. Which line do I need to fix? Also, how do you call a function? I am like brand new to JavaScript so I don’t really understand that much yet.

Hi @ghost_bentley

You called a function in the previous step.
Calling or invoking a function is how you can run a piece of code.

For the current step you need to assign that function call to a variable.

Happy coding

1 Like

HI @ghost_bentley How did you get past level 45 of this particular project? can you show me please…

That helped a lot! Thank you so much!! :grin:

Hello @TeeWhye, I cannot give you the direct answer but I can help guide you.

I would recommend making a new topic first though. After you do that I, or someone else, will be able to help you.

I already did that and i just only one reply but im still not getting it

@ghost_bentley @Teller
for (let i = 0; i < count; i = i + 1) {

rows.push(character);

}

This is what my code looks like now and im asked to use the .repeat() method in the .push() method

please do not ask in other people topics

1 Like