Lesson 3-for or while


Lesson 3-for or while

showing a syntax error.Anyone can help me please.

var count=true;
{console.log("I Love Coding");


Please, is this all your code? What syntax error are you getting, please? There should be a 'for' loop.

That said, this set of code will cause a browser crash. Your while statement should be 'true' which you've set as

var count = true

See below.

var condition = true;
while(condition) {
    // Says "Hello!"
    // Avoid infinite loops
    condition = false;


Thank You so much.It worked.:slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.