Iterating through a list in pairs
Sometimes, it is useful to be able to take a list of things, and traverse it in pairs.
For an example, if you had the list [1, 2, 3, 4]
, traversing it in pairs would result in the first iteration getting [1, 2]
, then [2, 3]
, and finally[3, 4]
.