I need a code check!


#1

I wrote this code for the rewiew and It says something's wrong with my synax. Can someone please check it?!

// Write your code below!
var myStuff = [43, 'hat', 'gnat'];

for(i=0; i > myStuff.length; i++;){
    console.log("for loop's done")
};

var number = true

do{
    console.log("Number is between 1 and 10");
}while(number);

while(number){
    console.log("The number is less than 5")
    number = false;
};

#2

Hey @cloud12345! Just a not needed semicolon in your for loop. Its in Bold

Hope it Helped!


#3

That worked but now there's a infinite loop somewhere. Can you do another check? :game_die:


#4

NVM I got it. I had to add

number = false

to my do/while part.


#5

Sorry @cloud12345 i didnt mention this, but at the end of the do statement you cant just do while(number); Thats an infinite loop.

So change it to something like this

do{
//code
} while(number==true);

#6

this is not an error but is it intended that this loop does not even run once?