Skip to content

Instantly share code, notes, and snippets.

@robertpateii
Created September 15, 2012 01:07
Show Gist options
  • Save robertpateii/3725899 to your computer and use it in GitHub Desktop.
Save robertpateii/3725899 to your computer and use it in GitHub Desktop.
my javascript utilities file
/*####---------------------BEGIN UTIITIES---------------------####*/
/**
* check for console. if it's not present, creates a console
* object with methods that do nothing. Thus you avoid errors
* in browsers without a console.
*/
if(typeof console === "undefined") {
console = {
debug: function() { },
dir: function() { },
error: function() { },
group: function() { },
groupCollapsed: function() { },
groupEnd: function() { },
info: function() { },
log: function() { },
time: function() { },
timeEnd: function() { },
trace: function() { },
warn: function() { }
};
}
/*####---------------------END UTIITIES---------------------####*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment