23
Warning: Spent 4 hours debugging a missing semicolon in JavaScript
Was working on a simple calculator app in JavaScript for my class project. Spent all Wednesday afternoon staring at the console trying to figure out why my function just wouldnt run. Turns out I forgot a semicolon after a return statement inside a nested loop. I was so mad at myself but honestly it taught me to use a linter right from the start now. My instructor laughed and said we all do it at least once. Anyone else have a dumb little mistake that wasted hours of your time?
3 comments
Log in to join the discussion
Log In3 Comments
claire_davis311mo ago
Totally been there... ended up using a linter plugin for my editor and it caught stuff like that instantly. Saved me so many headaches after.
6
beth2761mo ago
My buddy spent a whole afternoon chasing a bug once, turns out they'd written "==" as "=" in a conditional. Linter would've caught that in 2 seconds flat.
3
jessica7071mo ago
Yeah I read somewhere that most coding bugs are just stupid syntax stuff like this. Its honestly wild how one little semicolon can mess up everything.
2