What is the purpose of using a resistor in series with an LED?
Using a resistor in series with an LED limits the current flowing through the LED, preventing it from burning out. LEDs are sensitive to current and voltage changes, so the resistor ensures that they operate within safe parameters.