I'm sure this is a total n00b question, so apologies in advance, but I'm reading my Arduino starter manual and on project 2 the space ship interface, I noticed that LEDS are connected back to ground through a resistor. Where as in project 1 a resistor is used from power before the LED. The latter made sense to me as to reduce the amount of current to the LED, but the former doesn't compute? Why do we need a resistor to ground?