4 ms·
I don't get it. Is console.log a really annoying artefact that node.js creates or something?
by zacharyvoase 14y ago
I don't get it. Is console.log a really annoying artefact that node.js creates or something?
- Couto 14y agoconsole.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.
- zacharyvoase 14y agoThat was silly of me. I've used console.log countless times before. I just never thought of it as a thing that could be 'burned'.