Skip to content

Instantly share code, notes, and snippets.

@laurent22
Last active December 15, 2015 01:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurent22/5180305 to your computer and use it in GitHub Desktop.
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.
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