Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

how to declear sum of two numbers, i fail to pass the

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region


function addTwoNumbers(){

  return sum;
}
const sum=addTwoNumbers
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/126.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Declare a function named addTwoNumbers . This function should take two arguments and return the sum of those two arguments.

Your function does not take any argument and returns a sum variable that is never defined earlier

i tried but does not work

Hi @wilbenjamin7

So the forum can assist please post your full code.

Use the following method to post code to the forum:

  1. On a separate line type three back ticks.
  2. On a separate line paste your code.
  3. On the last line type three back ticks. Here is a single back tick `

Happy coding

A post was split to a new topic: Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

code redacted by moderator

if you have a question, please open your own topic about it