Lesson 8/11 while loops and for loops


#1

Not sure where to add the ")" as instructed by the syntax error
Check this out..

var condition=true;
while(condition);{
console.log("I know how to do those loops!")
condition=false;
}

for (var i=0; i<100; i++) {
console.log("I know my numbers:"+ " " + [i]:wink:
}


#2

@mr.meh,

1

For Javascript a semi-colon-; is an End-of-Statement indicator....!!!

Your semi-colon-;
like

while(condition);

the following while-code-block will NEVER be executed.

2

Change your

console.log("I know my numbers:"+ " " + [i]

into

console.log("I know my numbers:"+ " " + [i] );