Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

  1. Your function should not return a hard-coded value. That is, it should work with any two number arguments. ive been stuck for days please help i dont know what this means

Your code so far

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

function padRow(name) {
  return name;
}

// User Editable Region

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Welcome to the forum @corbinhugueley77

The example code uses parameters for the function.

This is the part causing the hard coded hint message.

Please reset the step to restore the original code, then add just parameters to the function.

Happy coding

Hello and welcome to our forum!

Use parameters as @Teller suggested and return the sum of those parameters instead of the sum variable. Also, delete the sum variable declaration and where you reassigned sum to a function, use const to declare the variable.

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