Created
March 19, 2012 18:31
-
-
Save rklancer/2123097 to your computer and use it in GitHub Desktop.
Console.log safety
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(){}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the basic idea. This particular snippet is borrowed from Sproutcore.