You probably have your JavaScript code littered with console.log(“blah blah blah”) statements throughout your code to test functionality and verify data. In production, you probably don’t want these statements written out for non-developers to see, so overwrite the window.console.log function with your own blank function that will get called instead.

// in ionic, production is set via environment.production
if (environment.production && window) {
  window.console.log = () => {};
}

// or without arrow syntax
if (environment.production && window) {
  window.console.log = function() {}
}