Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

Tell us what’s happening:

please help its not working i have trying but plss

Your code so far

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

function padRow(name) {

// User Editable Region

  return name;


 function addTwoNumbers(a, b){
 return (a + b);
}
  const a = 5;
  const b = 10;
  const sum = addTwoNumbers(a, b)
  
  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/133.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 55

You are missing a closing curly bracket }

1 Like

Hi. You are missing a curly brace at the end of your padRow function.

On this function, you don’t hard code with specific values. You need to be able to pass any number through it. You do this by calling the function, with values passed to it, for example: functionname(valuepassed, value passed). The instructions ask you to call the function with 5 and 10 passed as the arguments. You are then asked to have that as a value to a variable named “sum”. You have correctly logged sum to the console but you have not declared sum as a variable.

1 Like