Learn Introductory JavaScript by Building a Pyramid Generator - Step 50

Tell us what’s happening:

Hello, I tried to add a parameter to the function and there is no result. I do not know what I’m doing wrong. I tried searching the forum and couldn’t find the error.

Your code so far

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


// User Editable Region

function padRow(name) {
  return ""
  }

// 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/123.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 50

you added the parameter correcly, you need to follow the other part of the instructions now

Change your padRow function to return the name parameter directly.

Thanks, maybe I expressed myself wrong. I don’t understand what I have to change in my code to return the name.

you need to use the name variable in the return statement, as only what is in the return statement is returned

Gracias, ya pude pasar el código. Estaba usando comillas para “name”. Ese era el error. Muchas gracias!

awesome! good job! 

1 Like