Review (getting error)


// Write your code below!

var believe = function(){
    do {var trust = true
    {console.log ("Can I believe what you are saying") + trust + ("!"); var trust = false}
    while(trust) {console.log("You can trust me.")}

for (i=100; i<=0; i-=5){console.log(i)};


SyntaxError: Unexpected token '}'. Expected 'while' to end a do-while loop.


usage of do/while would look something like this.

//some code
} while(//something is true);

More about do/while here


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