News for hackers. Stuff that matters.
Re:Use console.log() like a pro (2020) by umaar on Monday April 12, 2021 @11:57AM (#26780898)
I've put over 200 tips like that on my website: https://umaar.com/dev-tips/

Each tip has a textual explanation, and an animated gif if you're a visual learner (I know, I need to scrap gifs and move to regular videos).

There's a lot of tricks there which can hopefully improve your development and debugging workflows. Let me know if there are specific things you'd like to see. A few people have asked for how to find memory leaks.

Re:Use console.log() like a pro (2020) by Felk on Monday April 12, 2021 @03:18PM (#26783844)
Speaking of memory leaks, I once had to debug a memory leak caused by console log entries. Objects that are logged to the console are prevented from being garbage collected, even if the console was never opened. That includes DOM nodes or I think also handles to WebGL textures.
Re:Use console.log() like a pro (2020) by umaar on Monday April 12, 2021 @05:14PM (#26785284)
Interesting, I think that's because logged objects are "live", so you can inspect their current state, not just the state at the point of logging.
Re:Use console.log() like a pro (2020) by franklyt on Monday April 12, 2021 @04:06PM (#26784478)
That’s interesting. I’m guessing console.log appends to the window object somewhere, which is a fairly common method of image preloading.
Re:Use console.log() like a pro (2020) by stexx on Tuesday April 13, 2021 @03:11AM (#26789028)
Great thing! Do you support rss feeds, so that I can stay up-to-date?
Re:Use console.log() like a pro (2020) by ajcp on Monday April 12, 2021 @12:06PM (#26781035)
Amazing! Thanks so much for this.