Ajax-loader-large-white
Introduction to 'For' Loops in JS
Why use for loops?

We are learning how to program because we don't want to do boring, repetitive work! The computer should do that.

This first exercise is a good example of exactly why you want to learn for loops.

Instructions
  1. Use five console.log statements to print out the numbers 1 to 5.
  2. Try not getting angry at me for this annoying exercise.
  3. Head over to the next exercise to see how we can use for loops to do this task more efficiently.
?
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Be sure to use a separate console.log statement for each number from 1 to 5!

Remember, console.log() works like this:

console.log(/* thing to print out */);
script.js