Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

I cannot find any help for this online, nothing works! and i dont know if its a glitch at this point becuase it DOES return the number 15 in the console plus an error message that im doing it wrong.. pls help!

my code: step 55 build a pyramid JS
function addTwoNumbers(arg1, arg2) {
const sum = arg1 + arg2;
console.log(sum);
}
addTwoNumbers(5, 10);

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers(arg1, arg2) {
  const sum = arg1 + arg2;
  console.log(sum);
}
addTwoNumbers(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 + row + "\n";
}

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

I think you need to return the sum of the 2 numbers, not output it to console

2 Likes

you’re right! i had finally found some obscure video that explained it. thank you