Search code examples
javascriptproduction-environment

Is bad practice keeping the "debugger" instructions on javascript on production environment


I am performing some fixes and improvements on an existing website before it goes into a production environment and I have seen a few javascript functions with the debugger statement in them, is it bad practice to keep them in the productive environment ?


Solution

  • If you are talking about the actual debugger statement, yes they need to be removed. When encountered in execution they may cause the scripts to stop executing.

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger