TIL a single missing semicolon cost me 4 hours of debugging
I was working on a simple JavaScript function last night to sort an array of numbers. The code looked fine to me, no red underlines in VS Code, no errors in the console at first glance. But the output kept coming back in the wrong order no matter what I tried. After about 2 hours I started checking line by line, even rewrote the whole function from scratch. Turns out I forgot a semicolon after a variable declaration way up top, which broke the next line's logic in a weird way. It took another 2 hours before I finally noticed it while squinting at my screen at 1 AM. Has anyone else wasted a whole evening on something as tiny as a missing character?