I was trying to code along a tutorial on using the “continue” statement in a while loop. In the tutorial, the code was written as shown below and it worked fine. but I tried it differently and it resulted to an infinite loop when I put the increment statement after the “if” block as shown below. I have tried to
Tag: break
Is using labels in JavaScript bad practice?
I just found out about using label s in JavaScript, such as: I’ve not heard about this until now and I can’t find much information online about it and I’m beginning to think there is a reason for that. It seems to me like this is similar to a GOTO statement in other languages and would be considered bad practice.