B
16

TIL a simple console.log trick from a coworker at a diner

I was stuck on a bug for like an hour. Just staring at my code. Running it over and over. This guy I work with at the restaurant saw me frustrated and said 'just log it out step by step'. So I threw in console.log after every line. Found the issue in 5 minutes. Why did nobody tell me this sooner? Anyone else have a super basic trick that clicked late?
3 comments

Log in to join the discussion

Log In
3 Comments
the_max
the_max11d agoTop Commenter
Wait why did I think that would make it worse?
8
brian_smith6
What exactly did you think was gonna happen when you tried it? Like were you hoping it would backfire and do something different, or did you just not think it through all the way? I've done that before where I knew an idea was bad but I tried it anyway just to see how bad it would get.
5
barbarah19
barbarah1911d ago
People do that all the time with small things, like poking a bruise just to see if it still hurts. It's like our brains need to confirm the worst case scenario actually plays out before we can move on.
1