Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

I’ve tried to understand what they even want from me on problem 55. I cant comprehend what they want. they still ask me to make a function called “addTwoNumbers” and I thought I did that?

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers(val1=5, val2=10){
  const addTwoNumbers = val1+val2;
  const sum = addTwoNumbers();
}
 console.log=sum
 
 
 
 
 
 
 const call = padRow("CamperChan");

// User Editable Region

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/126.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Hi and welcome to the forum.

You have a lot of mistakes here.

First mistake is the way you declared the function parameters. There should be no numbers there and no equals: just the two names of the parameters.

Second issue is the const variable you created was not given a new unique name. You tried to reuse the function name which is a bad idea.

Third problem is that you did not return the result of adding the two numbers.

Fourth issue is that you need to call the new function from “outside” the function scope and pass it the two numbers they said to pass it. (Then assign the result to a new const as they requested)

Finally you will need to log the return value.

Edit: here is some documentation to help you revise what you need to know about functions: Functions - JavaScript | MDN