TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Node.js "preprocessor" script to log from comments

1 pointsby bebrws9 months ago

1 comment

bebrws9 months ago
Yes, I know we should all be good enough to not need to ever use console.log statements, or to even iterate for that matter but sometimes I find myself tired and working on a project and just want to double check my data structure is in the correct state. If I use console.log I risk the chance of forgetting that line of code and submitting it to LeetCode which will cause a failure. Using this comment based approach makes logging easier and is "LeetCode safe" in that no console.log statements will ever be executed.