const character = "#";
const count = 8;
const rows = [];
function padRow(name) {
return name;
}
// User Editable Region
function addTwoNumbers(sum1 , sum2) {
return "5 + 10";
}
addTwoNumbers("5","10");
// 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/130.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 55
function addTwoNumbers(5, 10) but instead of 5 and 10 put num1 and num2, same for the body (of the function), you need to add a return adding num1 and num2
if you are calling the function you don’t use the function keyword. You also need to give two numbers there. The return keyword works only inside a function
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.
in this line, if you use quotes you are returning a string, you need to sum the two parameters with the + addition operator, in that way you are returning the sum
for this line, you need to separate the function definition and the sum variable. Remove the const sum = from the beginning of the line. Add it after the function definition, you need to call the function (use the function) passing in two numbers to the function
this is an example of calling a function with one argument