The console console.log () prints a lot of logs, will it affect the browser stutter?

console console.log () prints a lot of logs, will it affect the browser stutter?

May.22,2021

will have an impact, so you'd better rewrite the log function

when you publish.
console.log = function(){}

avoid using console.log in production
console.log objects will not be reclaimed by the browser garbage collection mechanism, which will cause browser stutters


automatic packaging tools such as webpack automatically remove this kind of output when releasing the official version


Yes, refer to https://developer.mozilla.org.://codeshelper.com/q/1010000006467170/a-1020000006467332.

console.time('time')
console.log(JSON.parse(JSON.stringify(new Object())))
console.timeEnd('time')

output:

VM52:2 {}
VM52:3 time: 3.43017578125ms
undefined
Menu