For-Looping for Beginners

Step 1: Declare Your Variables

Let's be real, this is the most exciting part.

For (let's be optimistic) each item in the list, we'll do something.

var item = items[i], where i is an index.

It's not like we're actually going to use this for anything interesting.

Step 2: Do Something With Your Variable

Now that we've got our variable, let's do something with it, like... like... um...

item = item * 2; // because math

We're getting close to being done here.

Step 3: Repeat Until We Get Tired

For (let's be optimistic) each item in the list, we'll repeat the process.

while (i < 10) { // because 10 is a big number}

We're basically just typing this out for the sake of it being there.