While syntax


plz help me with this one...

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


it gives an infinite loop.



while(i=1 )

you assign a value of one to i, you are not checking if i equals 1


can you plz help me out with the right code. I feel really bad but I m stuck at it for a while...


you have been stuck at the while loop for a while now, hmm :stuck_out_tongue:

In javascript, how do we check if things are equal? feel free to check earlier lessons/documentation


I am an idiot . ok I found out it was silly and the statement was ironical
stuck in while loop for a while
thnx for help.... its embarrassing


good you resolved the issue

A bit of irony helps :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.