Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

Tell us what’s happening:

Your function should declare a “test” variable.

I am soooooooooooo losttttttttttttttttttttttttt.

java unfortunately is entirely diff from html :sleepy_face:

Your code so far

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


// User Editable Region

function padRow(name) {
const test = padRow("Testing");
  return 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 + "\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/128.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

this is not Java, this is JavaScript


for your code, let’s see

you need to assing the string Testing to test, not a call to padRow

My bad, javascript.

Like this?

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

a string requirs quotes, that’s not a string

Even with the quotation mark it’s not working.

It keeps on saying " Your function should declare a test variable."

what’s your code now?

This;

function padRow(name) {
const test = "Testing";
  return character + name;
}
console.log(test);

this one gives you an error, you should remove this

Done, thanks

i also had to reset the lesson

lol

i must have overlooked this instruction" Remove that console.log to pass the tests and continue"

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