Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

I am honestly not sure what Im doing wrong here. I’ve tried this multiple ways. Its step 55. This is my code to add two numbers with a function. declare a sum variable calling my function with 5 and 10 as arguments and log the sum variable.

function addTwoNumbers(num1, num2){
return num1 + num2;
}
const sum = addTwoNumbers(5, 10);
console.log(sum);

Thank you for any help you might see.

Your code so far

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

function padRow(name) {

// User Editable Region

 function addTwoNumbers(num1, num2){
   return num1 + num2;
        }
        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 + "\n" + row;
}

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

where is the rest of this function?

its under the editable region…The step doesn’t use any other code on the page.

what do you mean under the editable region? you need to close the function body before writing the other function

and you deleted the return from padRow

OOOOOhhhhhh!! Haha, I just saw that. Thank you. That did it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.