Projects are the best way to learn to program. They bring theoretical nonsense into the real world and make it tangible. Instead of reading about how to create a loop statement instead you're making them and they're doing cool things in the browser.
Read