Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

Hi, I tried many variations (naming parameters differently like p1, p2 or a,b or num1 , num2 with and without spaces before and after commas, but seems to be indefferent) . I searched the forum here and googled it too. It keeps saying “You should have a function called addTwoNumbers.” I don’t understand why my function is not correctly defined. Could you please help?

Your code so far

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

function padRow(name) {

// User Editable Region

    function addTwoNumbers(p1,p2) {
    return p1+p2;
  }
  let 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Hi there and welcome to our community!

There’s nothing wrong with your code for this step (though the formatting could be tidier).

The issue is that you’ve lost a bit of code above your function declaration:

Should be:

function padRow(name) {
  return name;
}

Hey, thanks for the super quick answer! Yeah, I just realized that if I reset the lesson and put in the same code, I am able to continue. Thanks anyway!