Tutorials
THE WORLD'S LARGEST WEB DEVELOPER SITE

Exercise:

In this exercise, you are going to create a for loop from scratch. We have already created the counter variable i for you, and a text variable for output. Your task is to create a FOR LOOP that output the numbers 1 3 5 7 9 with line breaks between each number. WARNING: Remember to increase the variable used in the condition to avoid infinite loops (will crash your browser).

for (start at 1; output numbers as long as i is less than 10; count upwards by 2) { code block to be executed }