Probably everybody knows that LEDs don’t like current changes, so how to deal with this and avoid damages? One solution could be a circuit that provides a constant current despite variations of input voltage.

For instance this circuit can take up to 300mA and up to 40V and provide voltage that is necessary for one LED. [...]