Created
September 28, 2012 18:57
-
-
Save JordanReiter/3801535 to your computer and use it in GitHub Desktop.
Simple console polyfill -- does nothing if console is not defined.
This file contains hidden or 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
window.console = window.console || (function() { | |
var empty = function () {}, | |
functions = "log info warn error assert dir clear profile profileEnd".split(" "), | |
ff = 0, | |
fun = null, | |
return_obj = {}; | |
for(ff = 0; fun = functions[ff]; ff += 1) { | |
return_obj[fun] = empty | |
} | |
return return_obj | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment