@JediMasterAubie
I am sorry that I confuse you about transistors. In your example-project, the need of transistors is optional. But in some projetcs, a transistor is being use to switch on or off a bigger currents like a relay, a higher led current. The Arduino chip can only produce a current max of 40 mA <--- Close to that value is "risky" Go ahead if you want to lose your expensive Ardiuno board. A transistor is cheaper, in case something goes wrong <-- who care about a $0.25 per transistor. I prefer loose a quarter transistor compare to loose a $40 Arduino board.
About learning about transistors use as a switch... here a link : Transistor Circuits