a chronicle of my coding discoveries

While Loops vs. For Loops

I’m still half forgetting the difference between while loops and for loops most of the time (and when to use each one), while working in both my Codecademy JavaScript course and my Udacity Introduction to Computer Programming course. Since I’m starting the while loops section on Codecademy now, might as well hammer out the difference once and for all, so I don’t have to keep leafing through my notes.

According to Codecademy introduction to while loops: “‘While’ loops are like ‘for’ loops, only they don’t need a counter—they continue to run until their condition is met.”