11/11


#1

What am I doing wrong? Here is my code:

for(x = 0; x < 10; x++) {
console.log(x);
}

var i = true

while(i = true) {
console.log("Hello");
}
i = false

var j = false
do {
console.log("Goodbye");
} while (j);
j = true;


#2

you didn't put a semi colon to the end of the for loop


#3

@ravindudesilva No semicolons do not require semicolons after them.

@kirstenarlert The problem is probably this condition:

while(i = true) {

= is the assignement operator so this means make i be true no matter what it previously was and as assignments have the value you assign (here: true). This means effectively while(true) which is a classical infinite loop.