In an effort to disable console logs for production environments in my angular application, I implemented the code below. While it successfully suppresses logs in Chrome, IE 11 continues to display them.
Here is the snippet from main.ts:
if (environment.production) {
enableProdMode();
if(window){
window.console.log=function(){};
}
}
I'm wondering if this issue could be related to a polyfill problem. There doesn't seem to be any information available online regarding this specific discrepancy.
UPDATE:
This question appears similar, but does not offer insight into why overriding the console log function with an empty method functions in Chrome but not in IE 11.