15
Spent 3 hours debugging a missing semicolon in JavaScript
I was working on a simple calculator project for my portfolio and kept getting NaN errors no matter what I tried. Turns out I forgot a semicolon after a function call on line 47, which broke the whole chain of events. Has anyone else wasted an entire afternoon on something this basic lol?
2 comments
Log in to join the discussion
Log In2 Comments
josephb355d ago
Man, tell me about it. I mean, I've definitely had those days where you're staring at the screen for what feels like forever and it's just one stupid little thing. For me it's usually a missing curly brace or a typo in a variable name, and I swear I check everything twice before I finally spot it. Like last week I spent a good 45 minutes on a loop that just wouldn't run, and it turns out I had a period instead of a comma in a for loop. It's brutal how one tiny character can mess up everything you built.
2
joel2805d ago
@josephb35 been there with the period comma thing, hurts so bad lol. Used to think semicolons were optional in JS but yeah no, that mindset definitely changed after a few hours of debugging like that.
1