Last active
December 11, 2015 11:28
-
-
Save dhoko/4593324 to your computer and use it in GitHub Desktop.
Mon debug JS
This file contains 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
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(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
navigator.userAgent.indexOf('MSIE') >= 0
for IE