T
11

Spent 5 hours debugging a missing semicolon in JavaScript

I was working on a simple calculator project for my portfolio last Tuesday. Everything looked fine but the button clicks just wouldn't register. I checked my event listeners, my functions, even rewrote half the code. Turns out I forgot a semicolon after an if statement condition. Total time wasted was about 5 hours. Has anyone else spent way too long hunting a tiny syntax error?
2 comments

Log in to join the discussion

Log In
2 Comments
ray189
ray1891mo ago
Yeah but a semicolon after an if condition isn't even required in JS though.
8
bens81
bens811mo ago
Calling 5 hours on a missing semicolon a waste is a stretch. Thats just part of the learning curve with JS, especially if youre used to languages that dont care about them. You probably learned more about debugging in those 5 hours than you did from the calculator working in the first place.
5