Introduction to 'While' Loops in JS


#1

I put

understand = true

in the parentheses. I get an infinite loop even though I leave line 5 (understand = false) alone.

Am I doing something wrong? Thanks!


#2

Hi can you post your code?


#3

Wow, you're fast. I just went to grab it. Here it is:

var understand = true;

while(understand = true){
console.log("I'm learning while loops!");
understand = false;
}

Thanks again.


#4

This part

while(understand = true)

Remove the = true inside the while condition.


#5

Thanks very much! I appreciate it.