Skip to content

Instantly share code, notes, and snippets.

@ronanguilloux
Created September 19, 2011 08:53
Show Gist options
  • Select an option

  • Save ronanguilloux/1226166 to your computer and use it in GitHub Desktop.

Select an option

Save ronanguilloux/1226166 to your computer and use it in GitHub Desktop.
checking for existence of the console object properly:
// Source : http://goo.gl/ySY1w
if (typeof console == "undefined") {
window.console = {
log: function () {}
};
}
// variant : Disabling any console.log, the --force mode :
window.console = {
log: function () {}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment