G
24

Spent 3 months using '===' wrong in JavaScript

I was building a little quiz app for my portfolio, just a simple thing with multiple choice answers. Turns out I was using a single equals sign by accident in like 12 different places, so my comparisons were just assigning values instead of checking them. The quiz would always say 'correct' no matter what button you clicked, which felt nice but was totally broken. My buddy screen-shared with me and spotted it in like 30 seconds, and I felt so dumb. Has anyone else had a bug that made their code work in the wrong way for way too long?
2 comments

Log in to join the discussion

Log In
2 Comments
benwilliams
benwilliams10d agoMost Upvoted
Wait, isn't it funny how that's basically the same thing as when you're trying to be nice to someone but accidentally agree with everything they say? lol
3
charlie_ellis
Keeping it simple usually works, just nod and smile.
1