What does this code do?

Take a step back from the computer and think about what you're trying to do. How do you do it without a computer? Pretend you have a really dumb friend who has no idea how...