← Real Code

Loops: do it again

Remember loops from Robot Basics? JavaScript has them too! A for loop says: start here, keep going while this is true, and change the counter each time.

🎯 Use a loop to print the numbers 1 to 5, one per line.

Output

Press Run to see what your code prints.

Lesson 5 of 14 · Lesson map · Your code runs safely inside this page and is never sent anywhere.