Do/while problem


SyntaxError: Unexpected end of input

var u = true;
    u = 0;
for( u = 0; u < 3; u++) {

var condition = false;
do {
    console.log("I'm printed once!");
} while(condition);

var abc = false;
do {
    console.log("smt smt smt");

when I add the last do/while the error occurs. i thought it is same as the previous one. can't find the difference and problem.


Look at your closing curly brace
Correct syntax do while

} while (condition);


do {
console.log("smt smt smt");
while(abc); // shoud be oustside of brackets

what @codmakr said


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