4 ms·
console.log is a debug statement used in Javascript code. However is not supported in older browsers like IE8... If you forget to remove then, IE8 will crash a
by Couto 14y ago
console.log is a debug statement used in Javascript code.
However is not supported in older browsers like IE8...
If you forget to remove then, IE8 will crash and burn...
It may also affect performance, although that is usually negligible...
- 4lun 14y agoStripping out console.log as part of a build process tends to be the ideal solution, but on smaller projects it's nice to leave them intact so the below is my preferred method: if (typeof console == "undefined") { console = { log: function() {} }; };
- masklinn 14y ago> console.log is a debug statement used in Javascript code. However is not supported in older browsers like IE8... That is not quite correct. IE8 (and IE9 I believe) support `console.log`, but only when the developer tools are open. Needless to say, it is rather frustrating.