Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Hello, I’m new to the forum and I’m also having trouble solving this challenge. Can anyone advise on what I might be doing wrong?

const count = 8;
const rows = [];

function padRow(name) {
  return name;
}
const sum=addTwoNumbers();
function addTwoNumbers() {
    return sum;
}


const sum = addTwoNumbers(5, 10);
console.log(sum);

const call = padRow("CamperChan");
console.log(call);


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); ```

I moved your question to its own topic because you were asking a question related to your own code for a challenge and were not answering the OP of the other thread. It is always best to create your own thread for your specific question(s). Also, it is advisable to use the Ask for Help button on the challenge, so it auto-populates with your current code and the challenge url.

Thank you.

Welcome to the forum @MagsR21

Please delete the sum variable declared at the top of the above code block. The second sum variable is correctly declared.

The addTwoNumbers function needs to take parameters, then return those parameters in the function body.

Happy coding

1 Like

you need to insert in the parameters : a, b and then sum up a and b

2 Likes

Hi, I appreciate your guidance. I was finally able to solve this, thanks for the help!

2 Likes

A post was split to a new topic: Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

This is the right code for the step 55 in the program

Mod edit: code 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.

so, what is exactly missing at this point?

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.