int i = 0; // Initializing an integer with a value of 0 while (i < 10) { // While loop to repeat code until i is greater than or equal to 10 if (something) { // Check if the 'something' method returns true i++; // Increase value of i by 1 } else { // Otherwise if the 'something method' does not return true i += 2; // Increase value of i by 2 } } // End of while loop
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter