Learn Introductory JavaScript by Building a Pyramid Generator - Step 41

Tell us what’s happening:

need help checking my code it is saying that the for loop body should be empty

Your code so far

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

for (let i = 0; i < count; i = i + 1) {
  rows.push(i);
}

let result = ""


// User Editable Region

const rows = row;
for (const row of rows); {
console.log(row);
}




// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 41

if it should be empty, do not write anything in it

also, double check that semicolon, did you put it there when you wrote other loops?

I have made the for loop empty- and I have double checked my other semi colons

Also with making the loop empty it has led to other errors

What is your updated code?

const rows = "row";

for () {

console.log(rows)

}

That loop does not have an empty body.

how do you make the loop an empty body I have been stuck for hours

What is the body of a for loop? That feels like something a search engine might know?

You’ve misunderstood what I wrote- how do I make the loop an empty body as I cannot figure this out

No, I understand what you wrote. I cannot write the answer for you. Its against the rules and hurts your learning.

So…

What is the body of a for loop? That feels like something a search engine might know?

I’ve tried to use all available search engines aswell

Ok, what did all available search engines say about what part of a for loop is the body?

I get some good results if I search for ‘Javascript for loop body’.

Ok, the body of of a loop is is a set of statements that executed repeatedly

Ok, and where is the body of a for loop?

I got the answer, thank you so much Jeremy

P.s I was losing my mind lol

1 Like

the console was the issue btw

Right, because this is the body of the for loop.

1 Like