Learn Introductory JavaScript by Building a Pyramid Generator - Step 61

Tell us what’s happening:

Remove the name parameter from your function declaration, then remove your “CamperChan” string from the padRow call.

Also, remove both console.log from the padRow function.

Here is what I have:

function padRow() {
const test = “Testing”;
return test;
}
const result = padRow();

Your code so far

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


// User Editable Region

function padRow() {
  const test = "Testing";
    return test;
  }
const result = padRow();


// User Editable Region


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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 61

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

Hi there @Fasteddy !

Who asked you to add that result variable to your code.

I’m getting an error that says padRow function should not have
name parameter. I removed the name parameter and still now working?

that was the camper chan piece. it only asked to remove the camper chan?

Here is the original code that I started with before edits.
function padRow(name) {
const test = “Testing”;
console.log(“This works!”);
return test;
console.log(“This works!”);
}
const call = padRow(“CamperChan”);
console.log(call);

That’s not the original code, reset the challenge step and to restore the original code and see it.

@Fasteddy There is a call variable and the code before you have posted has the result variable.

I just hit reset here is the original code:

function padRow(name) {
const test = “Testing”;
console.log(“This works!”);
return test;
console.log(“This works!”);
}
const call = padRow(“CamperChan”);
console.log(call);

You should have not modify things in the code, that not asked in the challenge instructions.

ok this one works
function padRow() {
const test = “Testing”;

return test;

}
const call = padRow();

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