Skip to content

Instantly share code, notes, and snippets.

@dhoko
Last active December 11, 2015 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhoko/4593324 to your computer and use it in GitHub Desktop.
Save dhoko/4593324 to your computer and use it in GitHub Desktop.
Mon debug JS
var debug = true;
function trace(o, message){
if(navigator.userAgent.indexOf('MSIE') >= 0) {
return false;
}
if(debug){
if(message) console.group(message);
if(o instanceof Array){
for( text in o){
console.log(o[text]);
}
}else{
console.log(o);
}
if(message) console.groupEnd();
}
}
@dhoko
Copy link
Author

dhoko commented Jun 6, 2013

Add navigator.userAgent.indexOf('MSIE') >= 0 for IE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment