Tell us what’s happening:
I’ve got this right don’t I? I don’t see where there is an error in the code.
For this part I’m supposed to attempt to reference a local scope variable which I am doing. It keeps saying the test variable needs to be defined which does not make sense since it is clearly defined
Your code so far
const character = "#";
const count = 8;
const rows = [];
// User Editable Region
function padRow(name) {
const test = "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 + row + "\n";
}
console.log(result);
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 58