Infinite loop?



My browser is crashing everytime I perform this code and I cannot find a problem with it.

var boolean = true

while( boolean = true )
{ console.log(" this is a while loop")
  boolean = false 
for(var n = 1; n < 5 ;  n += 3)
   console.log( "this is a for loop")



while( boolean = true )

a single equal sign means assign, so then you get this:


which is an infinity loop, maybe it is an idea to check if boolean and true are equal?


Thank you. I can't believe I misssed that.