Why my browser crashed? simple "DO WHILE"


Why my code causes my browser crashed :anguished:
I think the code will print "aloaloaloalo" to the console because the condition m=2 is false. As a result, it will do the "do" statement.

var m=1;
var getToDaChoppa = function(){
    do {
    } while (m=2)



The = sign is an assignment operator. For conditions, you want to use the === comparison operator.


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