Skip to content

Instantly share code, notes, and snippets.

@mikedotexe
Forked from soquel/shorten_console_log.js
Created April 15, 2013 20:53
Show Gist options
  • Save mikedotexe/5391213 to your computer and use it in GitHub Desktop.
Save mikedotexe/5391213 to your computer and use it in GitHub Desktop.
function l() {
try {
// this works in Firefox/Opera
console.log.apply( this, arguments );
} catch (e) {
// this is for Chrome/IE
var args = [], i = 0;
while( i++ < arguments.length )
args.push('arg' + i);
new Function( args, 'console.log(' + args.join( ',' ) + ')' ).
apply( null, arguments );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment