Learn Introductory JavaScript by Building a Pyramid Generator - Step 59

Tell us what’s happening:

I have logged my string before and after return value but I keep getting this error;
// running tests
Your first console.log should come after your return keyword.
Your second console.log should come before your return keyword.
Please what am I doing wrong?

Your code so far


// User Editable Region

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

function padRow(name) {
  const test = "Testing";
  //second
  console.log("this works!");
  return test;
  //first 
  console.log("this works!");

}

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);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 59

Welcome to the forum!

Try the word ‘This’ in the strings with a capital letter. The test also gets derailed by the comments.

1 Like

seriously? It worked ooo :rofl: :sweat_smile: