I’ve gone through 6 forums now and found similar problems. I’ve change my arguments and made sure the return is a mathematical return. My const is the only thing I question but the error is that I need to use addTwoNumbers as my function, which I have. I’ve reset the lesson 3 times and input the same thing but continue to get the same error.
Your code so far
const character = "#";
const count = 8;
const rows = [];
function padRow(name) {
return name;
}
// User Editable Region
function addTwoNumbers(num1,num2) {
num1 = 5;
num2 = 10;
return num1 + num2;
};
const sum = addTwoNumbers(num1,num2);
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 54
Only advice I can give is to read each line of the instructions carefully and make sure you’ve implemented each one. Really take it step by step. You could even re-write the instructions as bullet points if it helps.
Declare a function named addTwoNumbers.
This function should take two arguments and
return the sum of those two arguments.
Then declare a sum variable and
assign it the value of calling your addTwoNumbers function