Tell us what’s happening:
for (“iterator” , “condition”, “iteration”) {
}
I do not understand why this is not working?
Your code so far
const character = "#";
const count = 8;
const rows = [];
// User Editable Region
for (iterator; condition; iteration) {
logic;
}
// 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/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 33
Hi. The body of the for loop should be empty. As per the instructions, put each of the words in your condition in quotation marks.
for (“iterator”; “condition”; “iteration” {
}
Still not working.
Have you put a closing bracket ) after “iteration”? Remove the emoji
Yes here is what i have
for (“iterator”; “condition”; “iteration”) {
}
I think that emoji came in due to the semi colon at the end of iteration.
Can you format your block of code by putting 3 backticks before and after the code? When I cut and paste it it didn’t recognise the quotes.
When I put this in a console it doesn’t like the quotes you use. Use ". Can you cut and paste the words and quotes again into your code from the instructions?
ok i cut and pasted the words from instruction to no avail. here it is:
for (“iterator”; “condition”; “iteration”) {
}
I left the ; off from iteration since it makes an emoji. But in my code the ; is there
Did you cut and paste the words and quotes from here?
In the upcoming steps, you’ll explore each component of a loop in detail. For now, construct a for
loop that includes the terms "iterator"
, "condition"
, and "iteration"
for the three components. Keep the loop body, the section within the curly braces {}
, empty.
Yes specially cut and pasted from there
OK it works for me when I cut and paste your code but I replace your quotes with the straight quotes from my keyboard. Try replacing with single quotes.
ok I have single quotes as here:
for (‘iterator’; ‘condition’; ‘iteration’) {
}
Can you put 3 backticks before and after your code to format it please.
If you edit your post above from 3 mins ago and place 3 backticks before and after the for loop
Yes I did exactly that. It didn’t post on here as such but yes i have done that
Example adding a pair of three back ticks:
(```)
Your code should be separate from back ticks like this text
(```)
Ignore the round braces.
1 Like
Put the backticks on the code in your forum post, above not the FCC curriculum. However if you cut and paste what you have there with the backticks into the forum we should be able to see it.