Serious question, I gave up on learning JavaScript for 3 months until a Tuesday chat at the Akron library changed my mind | Coding For Beginners - Topic Shares
Serious question, I gave up on learning JavaScript for 3 months until a Tuesday chat at the Akron library changed my mind
I quit my JavaScript course back in April after getting stuck on loops for the fifth time, and I was sure coding just was not for me. Then on a Tuesday in July I sat in on a free study group at the Akron library, and a retired teacher showed me how a for loop works using a deck of cards. She had me deal out 5 cards one at a time and say the number out loud, and something just clicked in about 10 minutes. Now I am 6 weeks into a different course and I actually look forward to the exercises. Did anyone else need a hands on way of seeing it before the ideas made sense?
Oh nice, the card thing makes total sense! Small fix though, dealing 5 cards one at a time is more like showing how a loop runs step by step, not really what a for loop is at its core. A for loop actually has three parts: where you start, when you stop, and how you move forward. Like "start at card 1, keep going while you have cards left, move to the next card." The dealing shows the repeat part, but the start and stop rules are the real trick. Once those three pieces click, loops stop feeling like magic.