Skip to content

Instantly share code, notes, and snippets.

@chrisjpowers
Created April 13, 2010 21:49
Show Gist options
  • Save chrisjpowers/365129 to your computer and use it in GitHub Desktop.
Save chrisjpowers/365129 to your computer and use it in GitHub Desktop.
Never have your javascript die from forgetting to take out console.log statements again!
// If console is not defined (ie the browser isn't
// using developer extensions), this will keep console
// statements accidentally left in the code from
// causing errors for the end user.
//
if(console == null) {
var console = {
log: function() {
// do nothing
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment