While syntax


#1

plz help me with this one...

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

}

it gives an infinite loop.


#2

here:

while(i=1 )

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


#3

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


#4

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


#5

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


#6

good you resolved the issue

A bit of irony helps :slight_smile:


#7

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