Skip to content

Instantly share code, notes, and snippets.

@voigt
Created January 13, 2014 12:49
Show Gist options
  • Save voigt/8399662 to your computer and use it in GitHub Desktop.
Save voigt/8399662 to your computer and use it in GitHub Desktop.
// 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