Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

Hi, I am not sure why it does not pass, I think I did what I needed to do

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

function addTwoNumbers(firstNumber, secondNumber){
  return firstNumber + secondNumber;
}
let firstNumber = 5;
let secondNumber = 10;
const sum = (firstNumber + secondNumber);
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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Hi. Your function and contents are correct.

The instructions say the sum variable should assign the value of calling your addTwoNumbers functions with 5 and 10 passed as arguments. You haven’t done your sum variable correctly.

Your console log is correct.

Remove your 2 x let variables as these are hard coded.

1 Like

I am trying but nothing working out, I can’t get it right.

managed to get it right. Thank you

1 Like