Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

Tell us what’s happening:

i am not getting it what is my mistake as i define it locally and check and the call it outside function its still giving me error plzz guide

Your code so far

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

// User Editable Region

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

console.log(padRow('example')); 
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/129.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 58

You should remove the console.log from inside the function.

Please follow the instructions to remove the last console.log.

Edit: you should remove both console.log statements that you added after the function. (In general, don’t add code unless requested.)

1 Like

thanks did that i was trying from last night sir sorry sir

If you are stuck still then copy all the code here in your next reply and we can suggest something to move forward.

no no sir its done i got the mistake just said in was trying from last night and it was just a minor mistake

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