Exercice 11 --> review


#1

Hello guys I'm kind of stuck here I would need some help please :smiley: here is my code :

var number = 1
while(number < 101) {
console.log(number);
number = number *2;
}

for(i = 1; i < 100; i++) {
console.log(i);
}

var condition = false
do {
console.log("I'm trying, nothing else");
} while(condition);
};

The sites keep saying SyntaxError: expected expression, got '}' and I can't understand why.

Thanks


#2

Remove the last closing bracket after the while(condition);,

do/while loop syntax,

condition = false
do {
    console.log('example')
} while (condition);
/*extra closing bracket not required*/

#3

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