Here's the code:
var n = 4;
while(n) {
console.log("Hey!");
n = 5;
}
Am I right here:
n is a variable, with value 4.
while n = 4, print "Hey" in console.
change value of n to 5.
check if n = 4.
n is not equal to 4, so stop executing the code!
Where am I wrong? I'm really frustrated! Edited it a million times! And the worst thing, browser crashes every time! Please correct me!