for-loops

Learn how to repeat a set of code as many times as you like, without using functions. For-loops are a fundamental part of every programming language. We'll see how to write them and how to use them with arrays.

We'll cover the following...

Loops are a new concept. They’re very powerful. They’re used to run a piece of code more than once so that we don’t have to write the same code over and over. They have different use cases than functions.

Let’s say we want to use console.log() ten times. We could write ten different statements, or we could use a loop.

for-loops

For-loops follow a format which might seem daunting at first. Try to get through it.

We start a for-loop by writing the reserved keyword for, ...