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 :)
Written by Ignácio R. Correia
Related protips
4 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Console
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#