22
Finally fixed a bug I'd been staring at for 3 days straight
Was stuck on a stupid syntax error in my JavaScript function until Tuesday when I realized I had a closing bracket in the wrong spot the whole time. Anyone else ever spend hours hunting a bug that ended up being one tiny character?
3 comments
Log in to join the discussion
Log In3 Comments
piper_kim8d ago
Just start commenting out half your code until the error disappears, that always saves me hours.
4
nancyn698d ago
piper_kim my last bug was a missing semicolon after 3 hours of commenting things out.
6
the_simon7d ago
3 semicolons got me in my first year of coding too, totally feel your pain. @piper_kim idea of commenting out blocks is good but honestly I find it faster to just use a linter or an editor that highlights syntax errors right when you type. Saves you from that whole "is it THIS line or that one" guessing game. Plus once you know the common traps like missing semicolons you start spotting them before they even happen.
7