Created
July 23, 2013 10:06
-
-
Save zeropaper/6061319 to your computer and use it in GitHub Desktop.
Ensure a console object with the following methods:
- info
- log
- error
- debug
- trace
- group
- groupEnd
- warn
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
var console = {}; | |
var methods = 'info log error debug trace group groupEnd warn'.split(' '); | |
for (var m in methods) { | |
if (typeof console[methods[m]] !== 'function') { | |
console[methods[m]] = function(){}; | |
} | |
} | |
window.console = console; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment