Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

Hi there, I have a problem with not understanding the question and how to execute the answer. I have searched other peoples problems and the solutions given, but I can’t understand what I am supposed to do here. Can someone give an example of what the formula is supposed to be and tell me why?

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers(5,10){
return 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; rv:130.0) Gecko/20100101 Firefox/130.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

they want you to make a function called addTwoNumbers that takes two parameters.
This function is supposed to return the sum of the two parameters.

So first thing you have to figure out:

  • do you know how to write a function that takes two parameters?

If you need more help than reviewing the previous steps, take a look here:

I have finally figured out the solution, but I still don’t understand the assignment it was giving me. " Declare a sum variable and assign it the value of calling your addTwoNumbers function with 5 and 10 as the arguments. Log the sum variable to the console." is a confusing statement to me, but I think i understand why now, it was missing an instruction at the beginning that (for me at least) needed to be there to resolve my confusion. If it had stated at the beginning to " Make a addTwoNumbers function without hard-coding." I think I might have understood it better.

the part of the instructions about creating the function says:

Declare a function named addTwoNumbers. This function should take two arguments and return the sum of those two arguments.
Your function should not use hard-coded values.

it looks like it says to not use hard-coded values

It asks for no hard-coded values in the function, a hard-coded value looks like this

function myFunc(10, 6){
return 10 * 6
//This value is hard-coded, It can only be changed by editing it in the function.
}

It should be similar to this

function myFunc(a, b) {
 return a * b
}
let product = myFunc(10, 6)
console.log(product)

This function would output 60.

Hope this helps!
Happy coding