Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

const count = 8;
const rows = [];

function padRow(name) {
  return name;
}

//for some reason its not working my code followed what ya mention on the previous replies //
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); ```
[/quote]

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 @edwinviches

Your code is missing

const character = "#";

from line 1 of the editor.

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

Thank you for the advice ill remember to do that next time and thank you for the assist it helped out

1 Like

Is there a reason why addTwoNumbers function is not working here? I plugged 5 and 10 as requested and the answer is not being accepted.