remove console.logs in a comfy way

by Ercan Cicek

HTML

<!-- the button on the left writes some infos into your console with console.log. 
After pressing the button on the right that will not working anymore -->
<p>START DEV TOOLS WITH F12 KEY</p>
<button id="consoleWrite">write into console</button>
<button id="consoleRemove">remove console.log functionality</button>

JavaScript

(function init() {
	document.getElementById("consoleWrite").onclick = function() {
    console.log("appCodeName: " + navigator.appCodeName); 
  	console.log("appName: " + navigator.appName);  	
    console.log("platform: " + navigator.platform); 
    console.log("userAgent: " + navigator.userAgent);
    console.log("----------------------------\n\n");
  };
  
  document.getElementById("consoleRemove").onclick = function (el){
		console.log = function() {}; // --- override console.log fn
    el.target.remove();
  };
})();