Wrote 500 lines of code before realizing I was using the wrong loop structure the whole time | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
Wrote 500 lines of code before realizing I was using the wrong loop structure the whole time
I spent 2 days debugging JavaScript for a landing page and it turned out forEach was way cleaner than the nested for loops I kept forcing. How did you figure out you were overcomplicating things?
Tbh I feel you on that one. I was working on a matrix multiplication thing last week and three nested loops were the only way to get it done without making a mess with recursion. Sometimes you just gotta stack them up and keep it simple, you know?