Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

the addition of the two arguments is been showed in the console, cant seem to crack this one so lf help!

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers() {
  return sum;
}
const sum = 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/127.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

You need to first pass two parameters to your addTwoNumbers(a,b) function then assign the values to your sum variable.

You should again reassign your addTwoNumbers() and pass the two number values 5 and 10 when calling it.

hi and welcome to the forum.

For your code, you have not actually completed the instructions which were:

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

Screenshot_2
like that?

hello, no, you need to read the instructions given to you.
For example: The instructions say that addTwoNumbers should take two arguments.
Do you know how to define a function that expects two arguments?
Start there.

Read more on functions if it helps here:

1 Like

thanks @hbar1st very good resource

1 Like