How big is console.assert() overhead?

Viewed 308

I use console.assert at a lot of places in my Javascript library. It's a good practice from software development point of view (it's easiest form of unit testing). But I would like to know how much it will affect the performance of my library when run in production.

  • Can browsers skip console.asserts when they get some kind of indication that the code is not running in development environment? e.g. Devtools is not open in Chrome
  • Can the bundling utilitiles like JS minifiers or Webpack/Browserify allow options to filter out console.asserts?
0 Answers
Related