Loops

Utilise the computer's power to repeat the same task over and over.

How Loops Work

Explanation

Click the button to start stepping through the code

Developer Console

Code

console.log('Starting!') 

  let i = 0 
  while (i < 5) { 
    console.log(i) 
    i = i + 1 
  } 

  console.log('Finished!') 

Variables: No variables yet