Introduction to 'While' Loops in JS


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!


Hi can you post your code?


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.


This part

while(understand = true)

Remove the = true inside the while condition.


Thanks very much! I appreciate it.