Please help, I have been stuck on step 41 of the JS Intro Pyramid Generator for 5 days now. The for… of loop
(You should declare a row variable.
You should use const to declare your row variable.
Your for…of loop should declare your row variable.
Your row variable should be extracted from rows using the of keyword.
Your for…of loop body should be empty.
// tests completed
)
I have no idea what to do now and I’m starting to feel a bit stupid, please help a brother out.
Your code so far
const character = "#";
const count = 8;
const rows = [row];
const row = "";
for (let row of rows) {
}
let result = ""
// User Editable Region
// User Editable Region
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 41
for (let i = 0; i < count; i = i + 1) {
rows.push(i);
}
let result = “”
console.log(result);
Hi, thank you for the response. So when I am at this point what should I do. Basically I do not know what to add into the for Loop as it keeps saying it’s wrong.
Alright, well the problem is that originally got this response : You should declare a row variable.
You should use const to declare your row variable.
Your for…of loop should declare your row variable.
Your row variable should be extracted from rows using the of keyword.
Your for…of loop body should be empty.
yes, the hint is trying to help you write the for loop (not to redeclare the rows variable).
Notice that the rows variable is a plural form of the word row.
And the hint didn’t say “You should use const to declare your rows variable” (they said row not rows).
So looking only at the for loop you wrote. Does it use ‘const’ to declare a row (no s) variable?
I am so glad I made it through, I’m planning on taking Bcom IT next year so I am basically checking my readiness to see if I won’t fail dismally when the time comes, I have to say so far not so bad, though I was seriously starting to doubt myself
The fCC programming you are doing may help you think more logically so that you can do better in the first two programming courses you will take. However, if the programming language in your school is Python, you will have different syntax and ideas to get used to there. (Might be worth jumping on Reddit to ask current students there what languages the first two courses use).
Beyond that though, the year 2+ courses (like db design, system design etc) are not discussed by the fCC curriculum.