Learn Introductory JavaScript by Building a Pyramid Generator - Step 54

Tell us what’s happening:

i am supoosed to add two numbers but i can’t get ti right

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers(sum) {
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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 54

Hi there. For this challenge, you need to create a function that accepts two arguments. Two variables. Inside the function body, you need to return the sum of the two variables.

Then below the function the function, you create a variable called sum. The sum variable is set equal to the return value of the addTwoNumbers with the numbers 5 and 10 provided as arguments. Afterwards, you need to log the value of sum to the console log.

Let me know if you need further clarification. :slight_smile:

so addTwoNumbers is just a name? Do I need anything in the ()?

function addTwoNumbers() {

}

No. The addTwoNumbers is a function. You need two arguments in this function then need to return the sum of those two numbers.

are rhe arguments 5 and 10? where do i put them?

the parameters of a function go between the round parenthesis, these are placeholder values that are assigned a value when the function is called, so they need to have names that are valid variable names