Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

Tell us what’s happening:

Fiquei perdida quando fala em acrescentar o test e na estrutura montada. Por gentileza. Quem tiver condições me ajude.

Your code so far

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


// User Editable Region

function padRow(name) {

  return character + name;
}
const test = padRow();
console.log(test);


// 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 Avast/131.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

Olá @lizaraxamg

A declaração da variável precisa estar dentro da função.

Boa codificação

Não deu Certo meu querido eu acho que não entendi qual variável.
return character + name , deu erro.

Tell us what’s happening:

Estou tentando bastante. Mas tem alguma coisa não estou entendendo se puder me exemplificar e mostrar . Fico grata!!!

Your code so far

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


// User Editable Region

function padRow(name) {

  return character + name;
}
const test = padRow(character+name);
console.log(test);


// 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 Avast/131.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

→ To see this in action, use const to declare a test variable in your padRow function. Initialise it with the value "Testing" .<-

sua função:

function padRow(name) {

  return character + name;
}

voce deve inicializar a variavel test dentro dessa função. do jeito que eles pediram