Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

i don’t know how to return both of the numbers because I can see the five and not the 10 so what am I supposed to code instead of return sum;?

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers(sum) {
return sum
}
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 (Macintosh; Intel Mac OS X 10_15_7) 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

Hi you need to declare your function with two argument and then return the sum of two aguments.

Hey there

According to the error message on the console

your addTwoNumbers function must have 2 parameters like a and b then return the sum of them using the plus operator like a + b

but currently, you only have 1 parameter sum and returned it

got it! Thanks for the help.

1 Like