A high school kid's dumb question fixed my for loop bug after 2 days
So last Tuesday I was stuck on a for loop that kept skipping every other item in my array output. I'm 34 and have been coding on and off for like 5 years, mostly tutorials and small scripts, but this one had me stumped. I posted on a Discord server and this 16 year old kid asked why I wasn't using a remainder operator to filter odd indexes. I literally stared at my screen for 5 minutes because I'd never even heard the term before. He explained it with a pizza analogy, like counting slices and only taking every second one, and it just clicked. I rewrote the loop in 10 minutes and it worked perfectly. Made me wonder how many other basic math tricks I skipped because I jumped straight to frameworks instead of learning the core stuff. Has anyone else had a beginner show them up with something simple? What was your 'aha' moment where a basic concept saved you hours?