by Shakeel Mohamed

How to silence your JavaScript console

1*M5qdWZrmmwW6WsKaPUiZHQ

Here’s a helpful tip for silencing your browser’s JavaScript console.

This enables you to unit test with 100% code coverage, while maintaining a clean test output on the console.

First you need some basic setup code:

Then, you can write code using mute() and unmute() like so:

This article originally appeared on Coderwall.