Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

It keeps telling me this is wrong
function addTwoNumbers(a, b) {
return a + b;
}

const sum = addTwoNumbers(5, 10);
console.log(sum);

but it keeps telling me its wrong. . 1. You should have a function called addTwoNumbers.
2. Your function addTwoNumbers should have two parameters.
3. Your function should return the sum of the two parameters.
4. Your function should not return a hard-coded value. That is, it should work with any two number arguments.

Your code so far

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

function padRow(name) {

// User Editable Region

function addTwoNumbers(a, b) {
  return a + b;
}

const 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 + row + "\n";
}

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

I copied/pasted your exact code in there and it passed for me. Are you sure you didn’t accidentally change some other part of the code? You might want to reset this step and try again.

In fact, that’s exactly what happened. Look at the function padRow in your code.

Thank You! I didn’t even notice that. No idea how that changed. I didn’t even know those lines were editable. RE-setting it worked and it re-added the 2 lines that somehow disappeared.

1 Like