Last Updated: February 25, 2016
·
698
· igcorreia

Console.log like a boss! Fastests approach

I use this every day in every project!

First:

function log(a){
       console.log(a);
}

Then:

log('Hello');

I hate right console.log all day long :)

4 Responses
Add your response

function log() {
  console.log.apply(console, [].slice.call(arguments, 0));
}

log('hello', 'world');
log('%c this sentence is coloured', 'background-color: yellow; color: blue');

this way you still support multiple arguments ;)

over 1 year ago ·

Like it :)

over 1 year ago ·

Cool :)

over 1 year ago ·

Cool :)

over 1 year ago ·