Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

I already function addTwoNumbers and I dont know whats the problem with it.
Can somebody explain it to me easily.
Thank you in advance.

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

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

// User Editable Region


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

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

You are trying to call your addTwoNumbers function, but you dont have one yet. First you need to declare it, and create its logic.

Declare a function named addTwoNumbers . This function should take two arguments and return the sum of those two arguments.

1 Like

do you mean like this?

function addTwoNumbers(5, 10) {
const sum = 5 + 10;
return sum;
}

you can’t use numbers here, you need to have two valid variable names. Also you need to make the function work with any number passed in

1 Like

I know you have explained it to me easily but I still cant understand it. Can you explain it to me more easily. I’m really sorry…

i have solved it
Thank you both for your advices.

1 Like

can you post your code? I`m stuck

Posting full working code is not allowed here on the forum and create your own topic to the challenge step by using help button that appears below the challenge editor, when you attempting wrong code more than three times.

1 Like

thank you so much bro !

hi @jasparel

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.