It's not only console.log
Many of us are aware of only console.log.
But console api in Chrome/Firefox has a lot of powerful methods -
- console.group, console.groupEnd - which help in grouping log statements.
- console.time, console.timeEnd - which help in measuring time taken by a snippet of code.
- console.profile, console.profileEnd - to create javascript profilers which will be stored in console.profiles array.
- console.timestamp, console.warn, console.info, etc etc..
More info - https://developers.google.com/chrome-developer-tools/docs/console-api
Written by Harsha B N
Related protips
2 Responses
Also, console.info, console.warn, console.error, console.assert, console.trace are very useful.
Hidden gem: console.error actually combines the functionality of log and trace so it's preferrable in many cases.
over 1 year ago
·
console.dir has always been useful for me :)
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#