← Back to all posts
Loop Help

Exercise states to make a "For Loop" until "i" reaches 6

for(let i=0; i < 7; i++){
console.log(i)
}

It is marking this as wrong

Luqmanali90 (0)

for(let i=0; i < 6; i++){
console.log("This is i:")
}

Durnsy (0)

I have spent way to much time on this one question.. Was this ever figured out..

function exerciseOne(){
// In this exercise, write a simple 'for loop' that starts the variable 'i' at 0 and
// increases i until it reaches 6.
// Fill in the blanks in the parentheses, and then console.log(i) inside of the fo loop
for( ; ; ){
}

mwilki7 (993)

Is that all the information they gave you?

StrategyGamesTe (0)

@mwilki7 Sorry should have pasted then entire lesson ... i just gave the basics .

function exerciseOne(){
// In this exercise, write a simple 'for loop' that starts the variable 'i' at 0 and
// increases i until it reaches 6.
// Fill in the blanks in the parentheses, and then console.log(i) inside of the fo loop
for( ; ; ){

}
for(let i=0; i < 7; i++){
console.log("This is i:",i)
}
}

function exerciseTwo(){
let count = 0;
// In this exercise write your own for loop (you can look at the syntax above).
// It should loop 10 times.
// You are given a variable called: count .
// For each loop reassign count to the current value of count + 1 .
for(let count = 0; count < 10; i++){
console.log(count)
}
return count;

mwilki7 (993)

``````for( ; ; ){
}
for(let i=0; i < 7; i++){
console.log("This is i:",i)
}``````

or just what you've put above

``````for(let i=0; i < 7; i++){
console.log(i)
}``````
StrategyGamesTe (0)

@mwilki7 I posted on the initial post my answer but the interface is saying my work is incorrect

mwilki7 (993)

@StrategyGamesTe
that’s odd
I can’t think of a reason it wouldn’t work. Is there any extra logging statements or lacking logging statements they want you to add?

@StrategyGamesTe : I think you have to complete all exercises to get the assignment as correct. For instance, in exercise 2, you have to say `count++;` instead of `console.log(count);`.

Klokat (41)

@StrategyGamesTe are you 100% positive that this

``````for( ; ; ){

}``````

is NOT part of your submitted answer/program? Because if it is it would make sense that it would hang.

Durnsy (0)