R
1

Spent 4 hours debugging a missing semicolon in JavaScript

I was working on a simple calculator project for my first portfolio site. The code looked perfect to me but nothing would run. I checked my loops, my functions, even rewrote half the logic. Turned out I forgot a semicolon at the end of a variable declaration on line 12. That tiny thing cost me 4 hours of staring at the same 50 lines of code. My buddy who's been coding for years just laughed and said it happens to everyone. Has anyone else had a bug like that where you felt dumb after finding it?
3 comments

Log in to join the discussion

Log In
3 Comments
john_murphy
Wait wait, 4 hours?
5
jakegarcia
haha yeah @aaronf40 you're so right, I used to think the same thing until I had a similar moment. totally feel your pain on this one. semicolons are one of those things where you either love em or hate em but you definitely learn to respect them after a bug like that. its wild how one tiny character can lock you out of running anything for hours. your buddy was right though, it really does happen to everyone at least once. i think every dev has that one bug where they feel super dumb after finding it but honestly its just part of learning.
4
aaronf40
aaronf402mo ago
Used to think semicolons were optional. Changed my mind real quick.
3