Learn Introductory JavaScript by Building a Pyramid Generator - Step 49

Tell us what’s happening:

Its sign I should assign call the result of your padRow call. I am actually lost

Your code so far

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

function padRow() {

}

// User Editable Region

padRow(call);
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 + "\n" + row;
}

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/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 49

Hi there,

As we can see in the definition of the padRow function:

function padRow() {
}

this function doesn’t take any argument. So, this line of code:

is not correct.


The instruction asked us to:

declare a call variable and assign your existing padRow call to that variable.

Here is what you did:

const call = padRow

Step 1:

declare a call variable

DONE! You did it with const call

Step 2:

assign your existing padRow call to that variable

Now, padRow is just a function name.
To make it a function call, we have to add the parentheses () after the function name.

3 Likes

try this
Mod edit: solution removed

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

i have the right answer is : [Mod Edit: Solution Removed]

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like