Skip to content

Instantly share code, notes, and snippets.

@rklancer
Created March 19, 2012 18:31
Show Gist options
  • Save rklancer/2123097 to your computer and use it in GitHub Desktop.
Save rklancer/2123097 to your computer and use it in GitHub Desktop.
Console.log safety
// prevent a console.log from blowing things up if we are on a browser that
// does not support it
if (typeof console === 'undefined') {
window.console = {} ;
console.log = console.info = console.warn = console.error = function(){};
}
@rklancer
Copy link
Author

This is the basic idea. This particular snippet is borrowed from Sproutcore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment