Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

How to group console.logs – Advanced JavaScript Logging Using console.group()

Posted on August 3, 2015 | Comments Off on How to group console.logs – Advanced JavaScript Logging Using console.group()

You can group related log statements by surrounding them with the console.group() and console.groupEnd() functions:
All log statements issued in between will be displayed as a group in the console view.

console.group("URL Details");
console.log("Scheme: HTTPS")
console.log("Host: example.com");
console.groupEnd();

Collapsing and Nesting Logging Groups

Note that the groups created by console.group() are initially opened. If you’d rather have them collapsed by default, you can call the console.groupCollapsed() instead:


Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Comments are closed.