How the game should work:

You'll notice that if you play the game, the second segment always just
moves down. This is OK for now!

Syntax Breakdown

array.forEach allows us to call a function with each item in a collection.
This is a very common kind of loop and is very powerful.

array.push adds the element it is given to the array it is called in.

Play Time!

array.map
is another kind of loop that makes it easy to build a new collection from an
existing collection. Rewrite the moveSnake function to use array.map
instead of array.forEach

The
for
and
while
loops are also quite common. They are more generally useful but harder to use
than the collection based forEach and map functions. How could you write
moveSnake with either for or while?