Last active
October 7, 2015 08:47
-
-
Save tcelestino/3136960 to your computer and use it in GitHub Desktop.
Detect browser support console
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
if(typeof(console) == 'undefined') console = { log : function(){} }; | |
if(typeof(console.log) != 'function') console.log = function(){}; | |
// color console.log | |
console.log("%c%s", | |
"color: red; background: yellow; font-size: 24px;", | |
"WARNING!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment