DEV Community 👩‍💻👨‍💻

Discussion on: problem with this Javascript code, im noob btw

Collapse
 
mranyx profile image
MrAnyx

Yeah, i forgot that point, if you're using a while loop, you should increment i before the if statement. otherwise, it will create an infinite loop. If you're using a for loop, the code i wrote above is OK