Lesson 10



I don't understand what is wrong iwth this code, i keep on getting the syntax error -

SyntaxError: missing ) after condition

var getToDaChoppa = function() {
    var arnie = 1
    do {
        console.log("I am programmed to protect John Connor");
    } while(arnie<2; arnie++);



this a do while loop, arnie++ should be inside the loop:

do { 
  arnie ++;
} while(condition)

the while loop can only have a condition, not the increment of a variable, that should be inside the loop itself


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