Skip to content
Advertisement

How do I skip a value using the while loop?

JavaScript

This creates an infinite loop, But I’m trying to skip 12, if I remove the increment it doesn’t display at all.

Advertisement

Answer

You need to increase w value before you do the skipping, one method is to do it inside the while condition:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement