DEV Community

Discussion on: Hide 🙈 all console logs in production with just 3 lines of code

Collapse
 
apvarun profile image
Varun A P ⚡️

This is a better option than assigning an empty function to console.log. The empty function removes the option to log anything in your production environment, even for debugging purposes.

If you are using Terser in your build, they provide an option to remove log statements (drop_console: true) from your minified code