Last active
December 15, 2015 01:29
-
-
Save laurent22/5180305 to your computer and use it in GitHub Desktop.
Fake Javascript console to avoid errors in browsers that don't support the feature.
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
if (typeof(console) === 'undefined') { | |
var functionNames = ['info', 'error', 'warn', 'dir', 'trace', 'log', 'assert']; | |
console = {}; | |
for (var i = 0; i < functionNames.length; i++) console[functionNames[i]] = function(){}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment