Created
January 17, 2014 05:59
-
-
Save xhinking/8469052 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// jshint devel: true | |
// make a copy of each `console` methods and adds them | |
// to the global object so that you can call `log('foobar')` | |
// instead of the verbose `console.log('foobar')` | |
// DO NOT USE IT IN PRODUCTION MODE | |
// @623HS | |
(function(global) { | |
'use strict'; | |
var name, value; | |
if (console && Function.prototype.bind) { | |
for (name in console) { | |
value = console[name]; | |
if (typeof value === 'function' && !global[name]) { | |
global[name] = value.bind(console); | |
} | |
} | |
} | |
})(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment