11. Review help. stuck in infinite loop


#1



I am stuck in lesson 11. Review.


My code gets stuck in an infinite loop and I cannot figure out why. Any help would be much appreciated.


for (var i=0; i<=100; i+5){
    console.log(i);
}
var iam=true;
while(iam){
    console.log("i am getting the hang of it");
    iam=false;
}
var head=function(){
    var butt=true;
    do{
    console.log("by george he's got it");
}while(butt);
}
head();


#2

your do while loop is a infinity loop, butt is always true, it will never change to false. You might want to change it to false, once you are inside of the do while loop:

do {
  // set butt to false
  console.log("by george he's got it");

#3

I added what you recommended and still have an infinite loop.

for (var i=0; i<=100; i+5){
console.log(i);
}
var iam=true;
while(iam){
console.log("i am getting the hang of it");
iam=false;
}
var head=function(){
var butt=true;
do{
butt=false;
console.log("by george he's got it");
}while(butt);
}
head();


#4

Incorrect + instead of +=. :slight_smile:


#5

THANK YOU!!! I was so frustrated. It is always the little things that trip me up.