12
My if/else block looked right but kept crashing, lost 3 hours to a missing semicolon
Yesterday I was working on a little calculator project in JavaScript, just adding a discount for orders over $50. The logic made sense in my head, but every time I ran it in the browser, the page went blank. I checked the if statement, the variables, even the console errors, but nothing clicked until I pasted it into a formatter and saw the semicolon was missing after a return line. It's funny how one tiny character can break the whole thing. Has anyone else had a bug like this where you stare at it forever and then feel kinda dumb when it's something so simple?
0 comments
Log in to join the discussion
Log In0 Comments
No comments yet
Be the first to share your thoughts on this discussion.